Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
Using a time machine =) – BloodPhilia Sep 23 '10 at 10:54

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .