Solved: /bin/rm: Argument list too long

Solved: /usr/bin/rm: Argument list too long
On Linux if you are trying to delete large no. of files then shell shows above mentioned message. After researching through several forums I found a solution for it. It’s similar to the earlier post related to taring large no. of files.


find . -name '*.txt' -print0 | xargs -0 rm

Note: Using “-print0” & “-0” escapes the spaces in the file name, otherwise it will be treated as multiple file names.

1 Comment