Seems rm linux command has limits (kernel limitation on the size of the parameters of the command)
If you try to delete too many files in a directory at the same time and receive an error message like this:
Argument list too long
must use the following command to delete files:
find /home/mydir/ -name ‘*.ext’ -print0 | xargs -0 rm -f
or this (delete all files from folder):
find /some/path/ -type f -exec rm -f ‘{}’ \;
where:
- -f, –force = ignore nonexistent files, never prompt
(WARNING: be careful with this command, you can erase wrong folder/files) - xargs = parameter to pass the delete command
- ext = file extension (can be * , all files )
[ Short URL ... ]



