Answer the question
In order to leave comments, you need to log in
How to delete a directory in Linux? :)?
There are a lot of files in a directory (on ext3).
1. rm -rf damn_dir (thinks for an hour, thinks for two, thinks for a day and won't be born)
2. ls damn_dir | wc -l (see point 1)
3. find damn_dir | xargs rm -f (thinks for an hour and, having filled in 16Gb of RAM, goes into swap and falls into the bark)
4. find damn_dir -type f | while read -r; do rm "$REPLY"; done (see point 3)
Any other options?
Answer the question
In order to leave comments, you need to log in
find . -delete
Finds and immediately deletes files.
As far as I remember, the other options first prepare the listing, and only then delete it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question