Deleting LARGE number of files

Sites, Brad BSites at mem-ins.com
Tue Apr 27 16:45:47 UTC 2004


On Tuesday, April 27, 2004 10:12 AM, Ryan Golhar is quoted as saying:

> I encountered the same issue and had to delete groups of files,
> something like rm a*, then rm b*.
> 
> 
> Ryan
> 
> 
> Okay, newbie question - and I can't find the answer on Google...  :-|
> 
> How can you delete the contents of a directory that has a
> HUGE number of files?  By huge I mean when "rm -f *"
> complains with "too many items" error message.  I don't care what's in
> there, I just want to wipe it all.
> 
> Thanks,
> 
> Chris
> 


The other option is a find command as such:

#find /directory/path -name * -exec rm -f {} \;

You shouldn't have any problem with the number of files using this method.

Brad Sites, RHCE





More information about the redhat-list mailing list