[LUAU] RE: How do you delete over 500,000 files in a directory

Jim Thompson jim at netgate.com
Thu Nov 3 16:38:30 PST 2005


Julian Yap wrote:

>Matt,
>I think that error message is because there are too many "m*" files.  I
>think it's possibly something to do with file handling limits.  Possibly.
>I'd probably do this:
>  
>
>>cd [directory with 500,000 m* files]
>>for FILES in `find -maxdepth 1 | grep '^./mgetty'`
>>do
>>rm -v $FILES
>>done
>>    
>>
>
>What that will do is find and remove files which begin with mgetty one by
>one, not as a wildcard removal.
>
>If you're feeling hesitant, I'd back up the directory first if possible.
>Then instead of using the line 'rm -v $FILES', do 'rm -iv $FILES'.  This
>will give you an interactive removal which will prompt you before any
>removal.
>  
>
You're going to be hitting 'y' for a long time.   Lets say you can get 
10/second, thats 50,000 seconds, or the better part of 12 hours.





More information about the LUAU mailing list