Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将以下几行组合为一个字符:
> ls file[1-5] > ls file[!3]
产生与以下相同的结果:
> ls file[1-2,4-5] > file1 file2 file4 file5
范围的正确语法是
ls file{[1-2],[4-5]}
它肯定会因上下文而异。在zsh中,您可以执行以下操作:
zsh
$ set -o EXTENDED_GLOB $ ls file([1-5]~3)