Tuesday, June 10, 2008

Argument list too long when using RM command

I ran into this issue myself when going to delete a large number of files from a linux drive...


I found the answer here:
http://www.moundalexis.com/archives/000035.php

But the easy answer is this... be very careful and navigate to the location where you want to delete everything and then use this command:
find . -name '*' -print0 | xargs -0 rm

Hope that helps, I know I will use this page to look it up in a few weeks when I forget again.

Labels: , , , , , , , , , , ,

1 Comments:

At October 23, 2008 11:01 PM , Blogger Legacyboy said...

I much nicer way with out the pipe
find /path/to/dir -name "*pattern*" -exec rm {} \;

 

Post a Comment

<< Home