有谁能告诉我,以"#“开头的文件删除方式有什么问题吗?
目录中的文件:
ola@ola:~/.scratch/hmm$ ls
five #four #one six #three #two
ola@ola:~/.scratch/hmm$
ola@ola:~/.scratch/hmm$ ls . |grep "#.*" |xargs rm -rf
ola@ola:~/.scratch/hmm$ ls
five six
ola@ola:~/.scratch/hmm$
Ps :参照以下问题提问
发布于 2016-05-04 07:39:28
ls
可能会在几个列中列出文件,而且您的regexp也不会锚定在文件名的开头。包含空格的文件名也会有问题。
https://stackoverflow.com/questions/37021224
复制相似问题