Bypass rm's “argument list too long” error message with xargs
March 2nd, 2009
No comments
When using rm to delete a large number of files, you may come up against a kernel limitation which limits the length of arguments that can be sent to rm:
$ rm *
bash: /bin/rm: Argument list too long
This one-liner utilizes xargs to bypass this limitation:
ls | xargs rm
Categories: Linux