Questions tagged [rm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
42 views

Centos :: Can't delete file with "rm" under "/", operation is not permitted [duplicate]

I have a CentOS server.It has been hasked.There are some malicious file under "/", like "/11db32e5", the AV scanner say it is a "HackTool/Linux.CoinMiner.n". But i cannot ...
you_know_who's user avatar
0 votes
1 answer
45 views

How to recover from running 'cd /var && find ./ -type f -atime 3 -delete'?

I intended to delete files under /tmp, however, I accidently did it under the /var folder with root user. I also stupidly hence run systemctl restart mysql :-( Now mysql service cannot start, and ...
Vincent's user avatar
2 votes
1 answer
13k views

Can't remove /var/lib/docker due to "Device or resource busy"

I've tried to uninstall docker and failed because I am not able to remove this dir /var/lib/docker and it gives me this error: (base) [xxx@xxx ~]$ sudo rm -rf /var/lib/docker/ rm: cannot remove ‘/var/...
Galilej25's user avatar
0 votes
1 answer
118 views

How can I remove many files with names that are encapsulated in single quotes? [closed]

I have a log directory with thousands of files that are named similar to this: ''$'\351\243\216\346\211\207\343\200\201\347\273\204\345\220\210'' strutstore A'$'\350\241\250''.xlsx' I want to delete ...
RubyRedGrapefruit's user avatar
0 votes
1 answer
201 views

does RedHat EL6 uses systemd?

Does EL6 uses systemd? OS DETAILS here Linux version 2.6.32-642.11.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) SMP Wed Oct 26 10:...
Tech User's user avatar
0 votes
1 answer
340 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
0 votes
1 answer
187 views

Glob match recursive delete directories except a certain directory

How can I delete all directories recursively where the name starts with app-deployment-* except a particular directory with name app-deployment-245a578. I.E. delete all directories using a glob match ...
Justin's user avatar
  • 5,398
0 votes
2 answers
568 views

rm -rf until success [closed]

I have a deployment script that removes all files in a tmp folder before continuing, but sometimes during the deployment, a process will use one of the tmp files, making the rmcommand fail. This is ...
santiago arizti's user avatar
1 vote
1 answer
961 views

Restrict rm command for for certain groups in Linux

I want to restrict rm command for certain group. I have implemented sudo on my Linux server. sudo rm <filename> is not permitted as I've restricted it. The issue is, if a user does not use sudo ...
Sheeze Mirza's user avatar
3 votes
2 answers
733 views

Delete all files & directories in a folder except one file

I want to delete all files & directories in a folder say 'A'. But except one file in that folder say .keep. I have tried the following command. find A ! -name '.keep' -type f -exec rm -f {} + ...
Dushyant Joshi's user avatar
-1 votes
1 answer
437 views

speeding up deleting a large directory by running rm -rf on multiple terminals

I have this very large directory that I'm deleting with : rm - rf . It is taking very long, so I opened up another terminal and try deleting the same directory with rm -rf parallely. Is this ...
Abhimanyu's user avatar
0 votes
1 answer
1k views

CentOS: eror when removing file: "rm: cannot remove '.viminfo': No such file or directory"

I have a file named .viminfo in home directory. I can see that the file is there by ls -lh: $ ls lh ... drwxr-xr-x. 2 mt1022 1091 4.0K Oct 12 2016 .vim -?????????? ? ? ? ? ...
mt1022's user avatar
  • 101
1 vote
4 answers
231 views

Delete files with odd file names [closed]

I have these two files in my home directory that I am unable to delete:- -rw-rw-r-- 1 steve steve 20551 Jan 27 23:51 \home\steve?esult_picture.png -rw-rw-r-- 1 steve steve 22238 Jan 27 23:...
Steve W's user avatar
  • 11
6 votes
3 answers
10k views

How to Fix Directory with all Question Marks as Permissions

I'm using CentOS 7 and trying to list a directory's contents but can't. When I try to list the contents, I get the following output: [entpnerd@myhost ~]$ ls -ali /data/sharedlogs/otherhost/ ls: ...
entpnerd's user avatar
  • 165
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
1 vote
1 answer
6k views

rm no longer asking for confirmation when deleting files?

On my CentOS 6.9 box I've just spotted that rm myfile no longer asks me if I really want to delete it, it just deletes it. I've run alias and there's nothing to do with rm there. What else could be ...
Codemonkey's user avatar
  • 1,108
0 votes
1 answer
3k views

rm: cannot remove ‘[name].rmanbkp’: Input/output error

I'm using Red Hat Enterprise Linux Server release 7.2 (Maipo) and have vgroup mount to folder is: /dev/mapper/vg_oradata-lv_oradata 886G 636G 206G 76% /bak. Now, In folder /bak have a some ...
Kotler's user avatar
  • 101
0 votes
1 answer
57 views

Why remove some files is so slow?

While tidying up some folders I saw that deleting some files is very slow : $ ls -lah a/ -rwxrwxrwx 1 user user 4 Nov 17 12:31 af8048e4aec858a02ac48119545413dd $ time (rm -v ...
JazZ's user avatar
  • 231
1 vote
3 answers
1k views

How can I *slowly* delete a large directory hiearachy to reduce disk i/o & load?

I have an ubuntu linux system. I have a directory which has a large amount of files. I can use rm -rf $NAME to delete it all. However that can use a lot of disk I/O and cause load to increase, because ...
Amandasaurus's user avatar
  • 32.2k
2 votes
0 answers
909 views

Safely deleting rsnapshot _delete folders

I have been using rsnapshot to backup a computer's / for approximately a year. The destination drive has filled up unexpectedly quickly within the last week or so, and the rsync command has failed, ...
Landak's user avatar
  • 121
0 votes
1 answer
206 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: https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-howto-...
hovey's user avatar
  • 1
23 votes
2 answers
6k 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 ...
aroth's user avatar
  • 393
1 vote
1 answer
450 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 ...
adjc98's user avatar
  • 13
1 vote
1 answer
2k 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 ...
Stella Martin's user avatar
3 votes
1 answer
1k 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 ...
Jesse Crossen's user avatar
0 votes
1 answer
772 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 "...
tudor -Reinstate Monica-'s user avatar
0 votes
1 answer
2k 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 ...
orb's user avatar
  • 1
37 votes
5 answers
7k 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 ...
MirroredFate's user avatar
0 votes
1 answer
2k 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 /var/...
johnnygear's user avatar
0 votes
2 answers
797 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 ...
user48058's user avatar
  • 863
-3 votes
2 answers
2k 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 '\...
George_223907's user avatar
1 vote
1 answer
477 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?
secure212's user avatar
  • 228
1 vote
0 answers
343 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: ...
Jen Zhang's user avatar
  • 111
1 vote
1 answer
131 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 ...
Martin's user avatar
  • 220
8 votes
3 answers
2k 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 ...
David Eyk's user avatar
  • 667
5 votes
5 answers
8k 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 ... ...
mahatmanich's user avatar
  • 2,984
1 vote
1 answer
186 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 /...
DevOps's user avatar
  • 730
3 votes
1 answer
20k 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 ...
Zulakis's user avatar
  • 4,233
-2 votes
2 answers
51 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 ...
rreeves's user avatar
  • 171
3 votes
2 answers
3k 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 "--...
yael's user avatar
  • 2,463
3 votes
3 answers
9k 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 `/var/www/app/...
Tombart's user avatar
  • 2,173
1 vote
2 answers
6k 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 ...
quickshiftin's user avatar
  • 2,165
3 votes
4 answers
986 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 ...
user788171's user avatar
4 votes
2 answers
3k 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 bilions of ...
Byakugan's user avatar
  • 141
2 votes
4 answers
743 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 of ...
Nick's user avatar
  • 143
1 vote
2 answers
101 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 ...
ckliborn's user avatar
  • 2,778
3 votes
2 answers
1k 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 ...
Charles's user avatar
  • 185
-1 votes
2 answers
450 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 -rw-...
shantanuo's user avatar
  • 3,619
2 votes
3 answers
524 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) ?
Iliyas Shirol's user avatar
3 votes
1 answer
116 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 ...
user784637's user avatar
  • 1,572