Deal with /bin/rm: Argument list too long


As a linux user or administrator, you will someday will need to delete files that pile up your storage. If there are a lot of files (I dont know exactly how much), it will report :

/bin/rm: Argument list too long

Here’s how to handle it :

find . -name ‘[FILE-PREFIX]*’ | xargs rm

For example you want to delete cache_* files, the syntax is :

find . -name ‘cache_*’ | xargs rm

Advertisements

About piyecarane

Bla bla bla about me
This entry was posted in Linux and tagged , , . Bookmark the permalink.

3 Responses to Deal with /bin/rm: Argument list too long

  1. test says:

    find . -name ‘[FILE-PREFIX]*’ | xargs rm -f

  2. Praz says:

    this worked perfect. thanks.

  3. из консоли ls -l /usr/local/vpopmail/domains/oldcomp.ru/abuse/Maildir/cur/ | awk ‘{print “rm /usr/local/vpopmail/domains/oldcomp.ru/abuse/Maildir/cur/”$9}’ | /bin/sh

    удаляет все !!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s