Questions tagged [rm]
rm is the command to remove files
849 questions
0 votes
3 answers
163 views
Why can't I use `rm -r` on a symlink pointing to a directory?
I understand that in unix systems symlinks can link to files and directories and are files themselves so if I want to remove a symlink I need to rm symlink without the trailing /. But they otherwise ...
0 votes
1 answer
79 views
Alias for rm does not include file name with @$ [duplicate]
I am trying to create an alias for the rm command in the /root/.bashrc file on a VirtualBox Redhat VM (running RHEL 9). I cannot get it to work properly. This is an excerpt of my .bashrc file: alias ...
-3 votes
2 answers
175 views
"rm -f" e-mails me an error, how do I prevent that?
I have cron "clean up" some stuff overnight. A simple rm -f thisandthat. But if there is no file thisandthat, rm -f sends an e-mail to me at [email protected] - No such file or directory. I ...
0 votes
1 answer
98 views
Strange "Directory not empty" for `rm -rf ...`command for %clean in rpmbuild of SLES15
After upgrading from SLES12 SP5 to SLES15 SP6 I noticed that the %clean phase of some RPM spec files fail for some strange reason when using rpmbuild -ba. The RPMs (SRPM, RPMs) are written correctly, ...
0 votes
1 answer
254 views
Inadvertently deleted a directory using FileZilla. How can I get it back?
I was using FileZilla to try to transfer some files. I made one mouse-click in the wrong place and wound up deleting a directory with over 14,000 files that I very much did not want deleted. I'm sure ...
7 votes
1 answer
2k views
Did I accidentally delete files? How can I recover them?
I’m a new PhD student and I’m dealing with a serious issue. I tried to map a directory from Server A (/home/lab/Desktop) to Server B (/home/usr/labDesktop) because Server B has better computing power. ...
0 votes
1 answer
151 views
Recursively delete empty files and then empty directories
The following script non-recursively deletes regular empty files, not including the dot ones, and then non-recursively deletes empty directories, not including the dot ones, and ignoring the presence ...
0 votes
1 answer
95 views
I deleted my /etc/alternatives/ by accident
I'm on ubuntu 22.04. I was there removing the files related to libcudnn. However, I thought i was CDing inside, but an enter later, I realized that I was on sudo rm -rfing there. So, I ended up ...
1 vote
3 answers
259 views
How to remove files which confirm to a certain number pattern
How to remove files which confirm to a certain number pattern I remove like this right now in MacOS, rm */sections.json.* */sections.json0* */sections.json1* all the way till 9
-1 votes
1 answer
234 views
What happens if sudo rm -rf /* is done in WSL?
NOTE: DO NOT USE THIS COMMAND UNLESS YOU KNOW WHAT YOU'RE DOING From what I've find on the internet, the sudo rm -rf /* command wipes out everything in the linux system. If this command is run on WSL, ...
0 votes
0 answers
163 views
Why is `mv -f source target` so much slower than `rm -f target && mv source target`
I got a case where I need to overwrite some file with another and noticed a very significant slowdown when using "mv -f" if the target already exists and is being read. More specifically, ...
1 vote
2 answers
118 views
rm on symlinks works different on Mac
The following commands behaves different between Linux and Mac: mkdir tmp ln -s tmp symlink rm -rf symlink/ On Linux, the content of tmp folder is deleted but the folder itself remains, while on Mac ...
0 votes
1 answer
256 views
How to delete a directory whose name has special characters
My ./imap directory contains two folders with names containing special characters : ‘No’$‘\351’‘.sbd’ ‘S’$‘\351’‘gol’$‘\350’‘ne.sbd’ (these are the full names with no other characters added). The ...
1 vote
1 answer
110 views
Remove all files, but write protected [duplicate]
In the folder there are files with write permission and without it. I need to remove only files which have write permission. When I simply do rm * it prompts confirmation for every write-protected ...
1 vote
3 answers
3k views
Removing a file does not increase available space?
OS is Debian. I am running as root. Output of df -h /: Filesystem Size Used Avail Use% Mounted on /dev/sda3 99G 97G 0 100% / lsof shows /var/log/syslog file handle is open, but ...