Argument list too long

If you have a ton of files in a directory and you need to remove them, but rm says that the "argument list [is] too long", just use find and xargs:

find . -name 'filename*' | xargs rm -vf

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Printed from: http://rackerhacker.com/2007/01/24/argument-list-too-long/ .
© Major Hayden 2010.

1 Comment   »

  • Dave says:

    What if the find command says the "Argument list [is] too long"?!

RSS feed for comments on this post , TrackBack URI

Leave a Reply