Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Operating Systems > Unix > Shell Scripting > Misc.     

How to delete a very large number of files on Unix


When you are trying to delete a very large number of files in a directory on Unix you may get
an error message similar to this: "Argument list too long" (I also had this problem on
Windows running cygwin). In this case you can use the following command, which will pass 100
files to rm at a time:

find /dir/* -print | xargs -n100 -i -t rm {}


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

  Support Forum  Posted by 
   Delete files with a different command       u2x  

Start new discussion or add comment to this tip

  Details
Tip reference : #46
views : 514
Added on : 11/09/05
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (162)
 
 
<< Previous
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Operating Systems > Unix : How to kill Unix user session  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Databases > Oracle : Kill user session  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Office Software | TipLib FAQ
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com