ERROR – /BIN/RM: ARGUMENT LIST TOO LONG !

目录 Linux

When trying to delete the files of a folder (using rm) with lots of contents in it , you might get this error :

/bin/rm : Argument list too long

The traditional rm command will not be able to delete too many files in a directory.
To get around this, use the command given below. Please note that the below command will delete all the files in the current directory in which you are logged into.

find . -name '*' | xargs rm

or:

find ./ -name '*' -print0 | xargs -0 -n 10 rm

暂无评论

发表评论