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

It takes forever!

Is there anyway to speed things up?

link|improve this question

58% accept rate
3  
Using a time machine =) – BloodPhilia Sep 23 '10 at 10:54
feedback

2 Answers

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.

link|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
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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