Questions tagged [rm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
18 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 ...
0
votes
1answer
28 views

does RedHat EL6 uses systemd?

Does EL6 uses systemd? OS DETAILS here Linux version 2.6.32-642.11.1.el6.x86_64 (mockbuild@x86-027.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) SMP Wed Oct 26 10:...
0
votes
1answer
82 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 ...
0
votes
1answer
39 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 ...
0
votes
2answers
159 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 ...
1
vote
1answer
71 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 ...
3
votes
2answers
198 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 {} + ...
-1
votes
1answer
65 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 ...
0
votes
1answer
619 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 -?????????? ? ? ? ? ...
1
vote
4answers
100 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:...
4
votes
3answers
3k 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: ...
6
votes
1answer
16k 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/...
1
vote
1answer
2k 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 ...
0
votes
1answer
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 ...
0
votes
1answer
45 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 ...
1
vote
3answers
517 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 ...
2
votes
0answers
410 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, ...
0
votes
1answer
124 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-...
23
votes
2answers
5k 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
345 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
1k 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 ...
2
votes
1answer
512 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
674 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
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 ...
35
votes
5answers
6k 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 ...
0
votes
1answer
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/...
0
votes
2answers
426 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
1k 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
1answer
455 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
334 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
111 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
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 ...
3
votes
5answers
5k 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 ... ...
1
vote
1answer
114 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 /...
3
votes
1answer
15k 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
49 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
2k 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 "--...
2
votes
3answers
6k 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/...
1
vote
2answers
5k 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 ...
3
votes
4answers
782 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 ...
4
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 bilions of ...
2
votes
4answers
614 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 ...
1
vote
2answers
96 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
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 ...
-1
votes
2answers
414 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-...
2
votes
3answers
450 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
113 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 ...
166
votes
30answers
81k 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 ...
8
votes
3answers
11k 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 (...
2
votes
4answers
3k 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 ...