The tag has no usage guidance.

learn more… | top users | synonyms

72
votes
23answers
26k 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 ...
0
votes
0answers
25 views

Packets dropped connecting to Azure VM through Point-to-Site RM Gateway

I've setup a point-to-site Virtual Network Gateway using the Resource Manager model. I followed both of these instructions: ...
18
votes
2answers
3k views

Will Ansible prevent the execution of 'rm -rf /' in a shell script

This is based upon this hoax question here. The problem described is having a bash script which contains something to the effect of: rm -rf {pattern1}/{pattern2} ...which if both patterns include ...
1
vote
1answer
54 views

Accidently ran rm -fr in a directory but nothing happened

Can someone confirm that running the command rm -fr without the / does nothing? I accidentally ran rm -rf in my command line and it seemed to do nothing. I am running a jail-shelled cPanel account ...
0
votes
1answer
68 views

Ubuntu OS recovery – accidentally deleted ld-linux-x86-64.so.2 from /lib64 folder in Ubuntu 14.04

I was remotely working on the machine with SSH but after deleting the ld-linux-x86-64.so.2 file by mistake I closed the ssh session and now I cannot login because it gives me following error: Welcome ...
1
vote
2answers
3k views

Can't delete corrupt files on Linux

So I got hit by a script kitte... Fortunately the box is Ubuntu and was able to replace w/ binaries from a comparable system, however, Some of the files I couldn't delete, and am still stumped on ...
121
votes
27answers
44k 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 ...
14
votes
3answers
51k 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
2
votes
1answer
89 views

Why does docker rm take almost 6 seconds to run?

I have a simple docker image based on ubuntu 15.10 that's just running bash. The image is around 1.2gb. It launches very quickly, but when I try to remove the container after it's exited, it always ...
0
votes
1answer
143 views

Single-file docker volume cannot be moved or removed due to permissions

Am I able to make it so that If I connect a single-file docker volume to a container, and the application makes an attempt to move or remove the file, the system allows it, rather than returning ...
0
votes
1answer
108 views

Cannot remove an empty folder with no user using by rm -rf

This is a solaris machine (unix) I have a folder contains some subfolders, but there is no file in it. root # ls -al `find trash` trash: total 6 drwxrwxrwx 3 root root 512 Aug 6 07:37 ...
35
votes
5answers
5k views

Could `rm -rf / --no-preserve-root` mess up the bios?

In order to see approximate speeds for tarballing an entire system, and then restoring that system when if it was foobar'd, I partially cloned one of our primary systems onto a workstation that, while ...
5
votes
3answers
414 views

Difficult to Delete Files in Linux

There's a lot of stuff about this on the Internet, but most of the examples there are contrived. How does one delete files that are really stubborn? e.g., $ find ./ -inum 167794 ./àKÈÿÿÿÿ@ $ find ...
0
votes
0answers
148 views

Proxmox-Server: Extremely high load during deletion-task of old backups

I'm using Proxmox to get some VPS. In Proxmox I set up some backup-tasks which are running fine. BUT: The backups are stored in big files (each backup has round about 300GB) so I can not store more ...
2
votes
2answers
439 views

Blocking rm -rf for application

I have application which during run-time generates interesting intermediate outputs to ./tmp directory. At the end of execution this directory is deleted. How can I preserve contents of it? I do not ...
4
votes
3answers
7k 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 ...
29
votes
11answers
23k 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 ...
0
votes
1answer
520 views

rm: cannot remove - Permission denied

Anyone have any idea why I can't remove these? ~# find /var/lib/php5/ -xdev -depth -type f -size 0 -exec ls -al {} \; -exec lsattr {} \; -exec rm -rf {} \; -rwxrwxrwx 1 root root 0 Jan 23 05:20 ...
2
votes
2answers
2k views

How can I reclaim bytes from a nearly full, 850G mongodb partition?

Woke up this morning to find out MongoDB grew to all available disk space for some reason. I cannot repair the db to compact it, as I have no space left. I can't even start postgres to remove an old ...
1
vote
5answers
868 views

How to remove a file where the file name has utf-8 character issues

I want to remove a file from a server via bash rm command. This is a sample file Test_ Mürz.jgp. How would one go about removeing files with such chars issues in the filename on a grand scale ... ...
0
votes
2answers
64 views

Delete oldest directory, skipping two of them

I have to delete oldest directory. But, two of directories does not have to be "included" in this action. So, directory content looks like this: [root@myserver backup]# ls -la total 84 drwxr-xr-x 21 ...
-3
votes
2answers
659 views

Remove all files in directory except last 20

I have question why is my cmd for "removing all files in directory except last 20" not working within cron but in command prompt yes. * * * * * ls -1tr /home/testusr/test | head -n -20 | xargs -d ...
1
vote
4answers
2k views

Cannot remove or list directory (ls or rm) Linux - Debian

I have a log file directory at /var/log/apache2/vhosts on a Debian dedicated server. Every day I split the main access_log into respective vhostname.com_access_log files in /var/log/apache2/vhosts In ...
1
vote
1answer
115 views

How to delete special character in linux

By mistake I made a file with the name \. How do you delete something like that? I've tried rm --\ rm "\" rm -- -\and nothing seems to work. I bet it's so simple but I'm stumbled - any suggestions?
1
vote
0answers
206 views

Composer runtime error when deleting subdirectories

I am running 'composer install' on my server, and then using the script feature to delete all subdirectories called '.git' but I am running in the following composer error. Delete all .git dirs find: ...
1
vote
1answer
89 views

Ubuntu server: Delete first folder in directory

How can I grab the first subfolder in a directory and delete it? I found a script to monitor the free diskspace. It sends an alert email if space runs low, but I want to also delete some unneeded ...
8
votes
3answers
891 views

How to keep subtree removal (`rm -rf`) from starving other processes for Disk I/O?

We have a very large (multi-GB) Nginx cache directory for a busy site, which we occasionally need to clear all at once. I've solved this in the past by moving the cache folder to a new path, making a ...
1
vote
1answer
88 views

How to increase deletion speed of several folder

I have a script containing about 420k lines of "rm -rf" command like which where generated using a "find" statement. Each pdf's folder is containing between 1 and 30 files (no subfolder). rm -rf ...
2
votes
1answer
5k views

vmware esxi - Can't delete directory, not even with rm -rf

I am trying to delete a directory but it's not working. When using rm -rf IPCop I get the error message rm: can't remove 'IPCop': Directory not empty. Another thing I noticed was, when executing ls ...
-2
votes
2answers
43 views

Ubuntu - utilities ask about each file? [closed]

I'm using Ubuntu 12.10 after doing something like sudo rm *.log it asks me about each file. do you want to delete 1234.log y/n ? do you want to delete 12345.log y/n ? It is having this same behavior ...
1
vote
2answers
452 views

rm + how to remove file with special Characters [duplicate]

I have this file in my linux machine: ----------9976723563nneh4_-----192.9.200.4 I try to delete this file but I cant as all see here: what need to add to rm in order to remove this file ? rm ...
1
vote
3answers
2k views

User can't remove symlink which owns

I'm trying to remove symlink, although I have appropriate permission, the operation is denied (the user is called capistrno): capistrno $ rm -f /var/www/app/current rm: cannot remove ...
3
votes
4answers
2k 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 ...
3
votes
4answers
460 views

rm intermittently causes disk to lock up

I have encountered this extremely strange problem on two servers now, both running CentOS5, both of them ext4. One is a SSD, the other is a regular hard drive, both SATA without RAID. The issue is ...
3
votes
2answers
2k views

How to delete files quicker than rm -rf? [duplicate]

Possible Duplicate: Millions of files in php’s tmp error - how to delete? Is there any way how to delete folder/files quicker than with command rm -rf? It seems my disc is filled with ...
2
votes
4answers
455 views

How to quickly remove hundreds of thousands of files? [duplicate]

Possible Duplicate: Doing an rm -rf on a massive directory tree takes hours I'm running a simulation program on a computing cluster (Scientific Linux) that generates hundreds of thousands ...
0
votes
2answers
86 views

Pausing deletion of directories if load is high

I have a list of directories that I'd like to delete. However when I do them all at one, load spikes on the box. Does anyone have an example of a script that would wait until load was under a certain ...
3
votes
2answers
584 views

How does `rm -rf` work

When I try rm -rf on a directory which has a lot of subdirectories and/or files and which is mounted with SSHFS, then I takes a while to execute. Is it normal ? I would like to know how rm -rf works ...
-1
votes
2answers
185 views

remove files starting with dash

I have (by mistake) created several files starting with a dash in my home directory. I can not select them nor delete them. # ls -lht -rw-r--r-- 1 root root 325 Mar 22 16:33 -s-vmstat-overall ...
1
vote
6answers
1k views

Linux console - prevent accidental deletion of files

Yesterday I deleted /etc by mistake. I remembered I found a software to prevent this kind of things but I can't find it anymore. I don't remember the name and actually Google is not helping. It had ...
2
votes
2answers
245 views

I removed the run directory of /var/run on Debian and need to fix it

Can anyone tell me how I can undo a sudo rm -r /var/run mistake? I am unable to use sftp and mysql now.
2
votes
3answers
340 views

Recover data from EXT3 filesystem

Our junior sysadmin accidently deleted some of the directories. Can anyone please suggest any free/proprietary application to recover files from an EXT3 filesystem (RHEL 5.x) ?
3
votes
1answer
102 views

What happens when you 'delete' a file as opposed to securely shredding it?

I read that when you delete a file, depending on the situation, its possible to recover its contents. What happens on a hardware level when you you 'delete' a file, ex. $ rm myFile as opposed to ...
1
vote
3answers
683 views

Very slow rm -rf on OpenVZ VPS with Debian 6 installed

I recently bought OpenVZ VPS and compared to a dedicated servers rm -rfoperation takes considerably longer to complete (about 4x - 5x longer). This is case even if there is one big file as opposed to ...
2
votes
5answers
865 views

Disable rm * on production servers

Is there a way to block rm with a single * in production servers? This would help prevent accidents like: rm test * instead of rm test*
2
votes
2answers
3k views

Delete files created 5 mins or earlier in a folder

On CentOS, how can I delete files which are created 5 mins ago or earlier in a folder? Thanks!
5
votes
3answers
132 views

directories with two one dot (.) entries

I'm trying to clean up my lost and found, and I've managed to remove most things, but I'm left with "almost" empty directories, like: lost+found/#14042862: total 1324 dr---wx--- 2 76040 43010 ...
0
votes
2answers
839 views

How can I remove a directory that I own when it contains subdirectories owned by another user?

I have created a directory /home/web/test on a Debian server using a basic unprivileged account web. Another account — tomcat — then created some subdirectories and files in that folder (as you might ...
4
votes
2answers
5k views

can't git rm a directory

I accidentally added a directory to the list of items i'm supposed to git commit. Now when I try to run a git rm dirname, I get the error rm 'dirname' fatal: git rm: 'dirname': Is a directory I ...
1
vote
2answers
939 views

Cannot delete a dir via SSH: etc/rc.d/init.d/functions': Operation not permitted

I am attempting to delete a backup directory on MediaTemple's (dv) via SSH. The directory is "old" and contains the entire server contents from OS level that (mt) backed up there after my server was ...