Linux: rm and the ‘Argument list too long’ error message.
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.
假设你要删除的目录中的词’spam’开头的所有文件:
bash: /bin/rm: Argument list too long
错误: 这发生在您试图删除一个目录在同一时间太多的文件-它似乎是有极限的….
为了解决这个问题
使用 ‘find’ 到 管道来匹配文件到 ‘rm’,一次一个
[root@yoursite filter]# find . -name ’spam*’ | xargs rm
问题解决:本文来自鹏鹏工作室的月影鹏鹏 http://jk.scanmon.com