开发者

match multiple files by the number in filename

I have many files abc_001开发者_开发百科.txt, abc_002.txt, ..., abc_999.txt in a directory. How can i select abc_001.txt ... abc_100.txt? i want to copy or tar them.


In Bash you can make a list of all numbers in a range: abc_{001..100}.txt


Try:

cp abc_0[0-9][0-9].txt abc_100.txt destination/

... or:

tar cvf archive.tar abc_0[0-9][0-9].txt abc_100.txt


You just need abc_0??.txt and abc_100.txt :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜