转载本站文章请注明,转载自: 月影鹏鹏 [http://jk.scanmon.com]
本文链接: http://jk.scanmon.com/wp/linux-rm-%e5%88%a0%e9%99%a4%e6%96%87%e4%bb%b6%e5%a4%aa%e5%a4%9a%e5%87%ba%e9%94%99%e7%9a%84%e9%97%ae%e9%a2%98%e8%a7%a3%e5%86%b3.html
Linux: rm and the ‘Argument list too long’ error message.
假设你要删除的目录中的词’spam’开头的所有文件:
bash: /bin/rm: Argument list too long
错误: 这发生在您试图删除一个目录在同一时间太多的文件-它似乎是有极限的….
为了解决这个问题
使用 ‘find’ 到 管道来匹配文件到 ‘rm’,一次一个
[root@yoursite filter]# find . -name ’spam*’ | xargs rm
问题解决:本文来自鹏鹏工作室的月影鹏鹏 http://jk.scanmon.com
Linux: rm and the ‘Argument list too long’ error message.
Let’s say you wanted to delete all the files in a directory that begins with the word ’spam’:
bash: /bin/rm: Argument list too long
ERROR!
This happens when you are trying to delete too many files in a directory at the same time – it seems rm has limits ….
To solve the problem:
Use ‘find’ to pipe all the matching files to ‘rm’, one at a time.