Questions tagged [rm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
123 votes
24 answers
68k views

rm on a directory with millions of files

Background: physical server, about two years old, 7200-RPM SATA drives connected to a 3Ware RAID card, ext3 FS mounted noatime and data=ordered, not under crazy load, kernel 2.6.18-92.1.22.el5, uptime ...
BMDan's user avatar
  • 7,269
32 votes
11 answers
29k views

How to make `rm` faster on ext3/linux?

I have ext3 filesystem mounted with default options. On it I have some ~ 100GB files. Removal of any of such files takes long time (8 minutes) and causes a lot of io traffic, which increases load on ...
user avatar
184 votes
31 answers
100k views

How do I prevent accidental rm -rf /*?

I just ran rm -rf /* accidentally, but I meant rm -rf ./* (notice the star after the slash). alias rm='rm -i' and --preserve-root by default didn't save me, so are there any automatic safeguards for ...
Valentin Nemcev's user avatar
10 votes
3 answers
13k views

Is there a way to delete 100GB file on Linux without thrashing IO / load?

I have a huge log file I need to delete on a production web server. I'm worried it'll bring the system to a crawl if I rm it on Linux. Any brilliant ideas? Update: Filesystem: ext3 Partition: /var (...
objectoriented's user avatar
29 votes
3 answers
231k views

Cannot delete folder with rm -rf. Error: device or resource busy

I'm trying to delete /var/www/html but I'm getting this error: rm: cannot remove `html': Device or resource busy
Hugo's user avatar
  • 291
10 votes
2 answers
35k views

cannot remove file, Device or resource busy

I tried removing a file. The most relevant answer can be found here, but I found no luck. Here is the original problem: maxgitt@mgpc:~$ sudo rm -rf /var/lib/docker/ rm: cannot remove '/var/lib/docker/...
Max's user avatar
  • 237
3 votes
4 answers
6k views

Can I recover from "rm /*"?

I'm running Debian... And, I accidentally ran "rm /*" as root (hurray!) - luckily I didn't use -r, so the dirs are still intact. However, when trying to boot, I get... run-init: /sbin/init: No such ...
Nick Bolton's user avatar
  • 5,146
0 votes
1 answer
341 views

I have deleted /etc/rc.d/ dirs, how can I restore them?

I have accidentally deleted /etc/rc.d and /etc/rc0.d folders which resulted deletion of init.d and other related folders. 1.What is the use of /etc/rc.d, rc, rc.d, rc0.d, rc1.d, rc2.d.......rc6.d and ...
Tech User's user avatar