rm and the 'Argument list too long' error message

If you have in directory more than 1024 files and you wish to delete them all at once, for sure you got error message "Argument list too long".
e.g. you did:
rm -f *.log

To solve this problem, pipe the names of files one by one to rm command like this:
find . -name '*.log' | xargs rm -f
It should be easy and still effective solution for you.
×