Welcome to Delicate template
Header
Just another WordPress site
Header

bash: /bin/rm: Argument list too long

December 28th, 2008 | Posted by Michaël in ICT

Today, I needed to empty a folder on my Linux server that containted a lot of files. The files where maybe 2kb, but all the files together contained over 400Mb.

So I used rm * to remove them, but it threw me a nice error: bash: /bin/rm: Argument list too long . Looks like rm has its limits :)

Use ‘find’ to pipe all the matching files to ‘rm’, one at a time:

find . -name '*' | xargs rm

And I’m a happy camper again.

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">