Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use rm -rf mydir to delete some large directories from my linux.

It takes forever!

Is there anyway to speed things up?

share|improve this question
3  
Using a time machine =) –  BloodPhilia Sep 23 '10 at 10:54

2 Answers 2

Stackoverflow question of interest has some good tricks,
Unix: fast 'remove directory' for cleaning up daily builds

And, what is a 'large directory' here?
A flat directory with lots of (maybe small) files?
or, a large directory tree (which may be wide or deep or both)?

Based on what you are deleting you may also want to lookup fastrm.

share|improve this answer
    
I don't have any experience with inn, but judging by the description, fastrm won't do anything faster than rm -r will (it's intended for a different pattern where only some files must be deleted in each directory). –  Gilles Sep 23 '10 at 20:15

To answer your question: it takes a long time when there are many files (and/or directories, which are a type of file under Linux) within the directory you're deleting. Each one has to be deleted as part of the process, which requires multiple changes to the file system.

How long is "forever" for you? The longest I've ever experienced personally was about 15 seconds.

share|improve this answer
1  
You're not trying hard enough: I've been waiting for a directory deletion to complete for over an hour now. :-) –  ebneter Sep 6 '12 at 3:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.