If you’re trying to delete a huge amount of files in Linux via command line, you may find yourself in a pickle.

Typing, say:

rm -r movie_queue_batch.php*

May tell you:

bash: /bin/rm: Argument list too long

However, an easy way out of this is by doing the following:

find . -name ‘movie_queue_batch.php*’ | xargs rm

The rule of a thumb goes as with all destructive commands in Linux: before “piping” it to xargs rm run the find command first so you may see which files will be affected.

Thanks to: http://www.moundalexis.com/archives/000035.php