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.
假设我有一堆文件,其名称包含一个数字,像这样:xxx_1.txt, xxx_2.txt, ... xxx_42.txt
在 bash 中,很容易对这些文件的子集进行操作,例如ls xxx_{1..33}.txt xxx_{35..41}.
ls xxx_{1..33}.txt xxx_{35..41}
tcsh 的类似物是什么?
据我所知,没有内置机制可以在tcsh. 但是,例如,您可以将该seq实用程序(如果可用)与以下内容一起使用sed:
tcsh
seq
sed
ls `(seq 1 33; seq 35 41)|sed 's/^/xxx_/;s/$/.txt/'`