/bin/rm Argument list too long – Linux
When you are trying to delete too many files in a directory at the same time, it seems rm has limits (kernel limitation on the size of the parameters of the command).
Example of using find command to solve this problem:
find /home/mydir/ -name ‘*.ext’ -print0 | xargs -0 rm -f
where:
- ext = file extension (can be * , all files )
- -f, –force = ignore nonexistent files, never prompt
- xargs = parameter to pass the delete command
WARNING: be careful with this command, you can erase wrong folder/files !!!
Categories: Bookmarks, Hosting, Linux delete command linux, find command, list too long, rm Linux error, xargs linux








