Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rm]

rm is the POSIX command to remove and delete files or directories.

0
votes
1answer
46 views

Why this hard-to-understand 'find' command broke my system?

I am using archlinux and I was trying to delete core dumps file to save space on the root partition. I stupidly ran this which I found in internet without really understanding it: sudo find / -xdev -...
0
votes
4answers
146 views

Cannot delete corrupted folder in windows 10

Today when I was trying to decompile .apk file using WinRAR, I got an error and unzipping terminated. After that when I am trying to delete the folder I am getting an error that I don't have ownership ...
0
votes
0answers
97 views

How to fix an APFS corruption?

A few weeks ago, I copied some directories from an old external hard drive to my iMac. I ended up with a few corrupt files due to the bad state of this ancient hard drive. I managed to delete them, ...
2
votes
1answer
533 views

Removing “rw-r--r— root/wheel restricted” files in MacOS leave some files left

I've just discovered a 4.5Gb /Previous System/private directory, caused by a (recent) upgrade to 10.13 (the dates seems to match). Since it weighs heavily on my available space and I don't know why ...
1
vote
1answer
95 views

Why does rm over NFS not free space immediately?

I'm on a SUSE Enterprise server which has mounted a drive via an NFS mount. I have created a 34GB file via dd if=/dev/Zero of=test_file bs=8k Count=4194304 to test the write speed of the NFS share. ...
1
vote
2answers
130 views

remove a file with corrupted name

So this happened: $ ls ''$'\342\200''abc2.16.5' $ ls | od -c 0000000 342 200 a b c 2 . 1 6 . 5 \n $ ls -il 76236897 -rw-rw-r-- 1 mob users 0 Aug 16 17:52 ''$'\342\200''abc2.16.5' ...
0
votes
1answer
31 views

how to delete all files that are old then X days and ended with number/s

we want to delete all files that ended with number with digit or more as 2 digit or three digit and so on note - when files is ended with number , its tell us this file was rotate and actually backup ...
1
vote
2answers
623 views

Unlink (remove) directory symlink

I did: ln -s /DATA/ ./base_DATA/ and I'd like to unlink. Simply: unlink ./base_DATA but... unlink: cannot unlink './base_DATA': Is a directory According to this answer (and many other online) the ...
1
vote
0answers
38 views

Deleted the /use/bin/python3

I accidentally deleted the /use/bin/python3 by using rm -rf /use/bin/python3 and now it is showing bad interpreter: no such file or directory. How do I restore it back ?
0
votes
1answer
122 views

Debian 8.9 restore deleted but locked files

I accidently ran rm -R /home/. My Homefolder contained several disks of virtual machines which were in use at this moment. I also got the error, that some files could not have been deleted. ...
1
vote
1answer
47 views

Deleting MythTV logs

My TV software setup stopped working recently. I tracked down the issue to a lack of disk space and and ran ncdu to check what was up. Turns out, MythTV logs are consuming nearly 1GB of space on my ...
2
votes
0answers
2k views

'Permission denied' when trying to delete file as root on macOS

I"m trying to delete: -rw-r--r-- 1 root wheel 507 Sep 22 04:10 com.mcafee.reporter.plist on macOS 10.13.1: bash-3.2# rm -f /Library/LaunchAgents/com.mcafee.reporter.plist rm: /Library/...
1
vote
1answer
96 views

rm -irf -Irf with find

why below statement do not ask for confirmation while using option i or I for rm ? // pass aggregated find . -name $name -type d -exec rm -irf {} \; // pass each find . -name $name -type d -exec rm -...
1
vote
1answer
120 views

What happens after rm -rf / on dual boot machine

I was given this machine at work which had Windows on it and I dual booted it with Linux (Ubuntu if matters), and now I'm curious what will happen if I wipe out linux with sudo rm -rf / before give ...
7
votes
1answer
3k views

How was I able to remove a root owned file without sudo [duplicate]

I had the following output for ls -lFh: -rw-r--r-- 1 hjpotter92 hjpotter92 926 Aug 2 18:40 static.yaml drwxr-xr-x 5 hjpotter92 hjpotter92 4.0K Sep 12 19:40 templates/ -rw-r--r-- 1 root root ...
0
votes
2answers
437 views

macOS - cannot rm without sudo

Brand new owner of a Mac, getting to know the machine. I have stumbled upon an issue that is quite bothersome - I cannot use rm without sudo. Indeed anytime I write an rm command, the result is the ...
0
votes
3answers
301 views

What does “rm -rf” do?

I have seen the command rm -r, rm -f, and rm. I was wondering what does rm -rf do, I have looked all over and can't seem to find the answer
0
votes
0answers
133 views

Can not remove folder with rm -rf

I am using CMDER, while I try to remove a large folder with command 'rm -rf' the terminal freezes. It seems that rm process is running, but without expected result. I tried to create a new folder with ...
1
vote
1answer
3k views

rm file “Operation not permitted” even when sudo

Im working with python 2.7 and I was having import errors with random, So I checked the path and noticed it was using random.pyc instead of random.py I tried to remove the file but it won't work. ...
0
votes
1answer
812 views

Can “sudo rm -rf --no-preserve-root /” on Linux destroy a Windows partition if run using dual boot?

I'm not crazy enough to test it out, but I'm curious to know if sudo rm -rf --no-preserve-root / would have any effect on other operating systems on the disk, or if it's safely contained.
0
votes
1answer
2k views

Why does rm not remove directories? [duplicate]

To delete directories you need to use the command rmdir instead of rm. I learned that unix sees everything as a file. So what is the reason that rm can't delete any type of file?
4
votes
1answer
4k views

WinSCP - How to Zip, Download and Delete a file?

How is it possible to Zip, Download and Delete (ZDD) a file in WinSCP? For example, your local dir is Desktop and your remote dir (the one in your server machine) is, say, /var/www/html and you want ...
1
vote
0answers
105 views

Linux rm file / folder with non printing characters “\032”

git status shows: Untracked files: (use "git add ..." to include in what will be committed) "\032" ls shows that folder as ? I've tried: $ rm "\032" rm: cannot remove '\032': ...
1
vote
1answer
542 views

How to use “rm -rf --no-preserve-root” in bash on Windows

After turning on Developer mode and installing the Windows Subsystem for Linux, how can I use the rm command in the bash shell running in Administrator mode? Example: rm -rf --no-preserve-root C:/...
0
votes
1answer
1k views

Cannot delete file - No such file or directory

Issue: I have a file sitting on an NTFS partition that I am unable to delete or move. I am able to view the file. This is also preventing me from reading that directory while inside Windows. I get ...
3
votes
1answer
523 views

Cannot delete a dir as `root`, even after a `chattr -i`

I am trying to delete a directory, foo, and am totally out of things to try. Note: I know, I'm not supposed to delete LxD containers with rm, but I'd messed up this directory's contents earlier, and ...
0
votes
1answer
63 views

How to delete accidental copy of cache file

I have a ubuntu server running that uses a windows share (mounted via /etc/fstab). While trying to copy some data to that newly mounted directory I accidentally copied /var/cache too. Now the problem ...
0
votes
0answers
105 views

Efficient `rm` of hard links?

Suppose these is a file foo. Then, suppose I create a hard link: ln foo bar I can delete bar by running rm bar. However, it looks like when there are lots and lots of hard links, using rm is as slow ...
3
votes
2answers
1k views

Undelete an “rm -r” on an exfat external hard disk device

There are several questions about how to undo an rm -r command, however in this specific case I have an exfat formatted partition / hard disk, rather than, for example, and ext4/ext3 formatted disk. ...
6
votes
3answers
8k views

Mac OS Sierra and srm

I had a script for securely emptying my trash bin from time to time and I was using srm. I suppose people would still have uses for srm. However, it appears that srm no longer ships with mac os. Are ...
1
vote
0answers
110 views

can't delete directories from RAID trash

I have a 9TB RAID 0 comprised of 3x3TB drives. I can't delete some directories that have been moved to the trash. Volumes/LTO ≈:≈ sudo rm -vrf ./.Trashes/ rm: ./.Trashes//503/c/c: Directory not empty ...
0
votes
2answers
10k views

What is the difference between rm -r and rm -f?

From manual: -f, --force ignore nonexistent files, never prompt -r, -R, --recursive remove the contents of directories recursively Though this options description is different, when trying to ...
1
vote
1answer
110 views

Unable to rm -rf .nfs0000000008547f6500007f62 file on linux server

When I do a rm -rf directory It says a message like : rm: can't delete directory/.nfs0000000008547f6500007f62 ressource occupied and I don't know why.
0
votes
1answer
58 views

How to remove file on Linux with ? in name

Cannot move or remove file with ? in name. Any ideas? Have tried the following: # ls manager?%80%99s-viewpoint.html what-wcsap-can-offer-you-?%80%93-guide-new-directors.html # mv manager\?%80%99s-...
0
votes
0answers
893 views

How to make a busy file not busy so it can be deleted. rm: filename: Resource busy

I have somehow generated a file on a network mounted volume that is in the busy state, and I have no knowledge of what could be using it. I want the file gone, and am not really concerned about ...
0
votes
1answer
472 views

Delete all the folders and file except one folder

I want to remove all the folders and files but except one. I have a Ubuntu server and I tried several methods and none of them worked. This is my folder structure. app app/public app/public/uploads ...
1
vote
2answers
613 views

Root user can't remove folder

There is a folder /mnt/shared which root user can't access/modify or remove. # ls -lai /mnt total 4 16662 drwxr-xr-x 3 root root 0 Mar 27 14:30 . 2 drwxr-xr-x 23 root root 4096 Mar 27 14:26 ....
1
vote
1answer
145 views

unable to remove symbolic links of rsync copy of /bin and /dev

I accidentally made a rsync copy of my root directory, "/" using the -a option, as follows: user@mycomputer:~$ rsync -a / /backup-dir user@mycomputer:~$ ls -l /backup-dir/ total 10102784 drwxrwxrwx 1 ...
0
votes
1answer
2k views

Remove backups older than 7 days except first of every month

I want to delete backups older than 7 days but keep the first of every month. The name of the files is: name_$(date +\%d\%m\%Y).tar.gz I want to keep: name_$(date +\01\%m\%Y).tar.gz I want ...
1
vote
1answer
58 views

Recursive removal, preserve directories in Linux

In a Linux command line is it possible to - without prompting - recursively remove files (like with rm -r [path]), but preserve directories under [path]? EDIT: For the interested, I've used Paul's ...
0
votes
1answer
97 views

User can't delete file owned by user with w permission

I've a backup system based on rsync. Get a problem when try delete one file srv106@storage10:~$ rm -vf /srv/storage/homes/srv106/daily/files/daily.32/root/.my.cnf rm: cannot remove `/srv/storage/...
-1
votes
3answers
151 views

Remove all files but one folder with rm

I want to use rm -rf to remove files/folders inside a folder, but skip or ignore a specific folder. It has been suggested as duplicated to another quesiton, but that is not the case. The other ...
0
votes
1answer
1k views

How to kill/rm pipe by inode number only?

EDIT: I originally cut and pasted a question I'd asked earlier on stackoverflow that got closed: https://stackoverflow.com/questions/32622224/how-to-kill-pipe-by-inode-number-only I've now run into ...
-3
votes
1answer
931 views

Couldn't remove a directory, already tried rmdir -rf

I kept on trying to remove a folder in the server, but I kept on getting a same error. Please help me. I used this post as a reference https://askubuntu.com/questions/217893/how-to-delete-a-non-...
0
votes
0answers
70 views

Accidentally partially deleted home directory . . . Killed with ctl-c, which file is corrupted?

I was running some software in my home directory (last time I do that!). Stupid config file asks what directory I wanted to put my output files. I accidently used ~/ as my output directory. It ...
0
votes
2answers
172 views

override environment variables

I would like to override a particular environment variable on a one-shot basis. The system currently has a variable for the "rm" command, forcing verification for each file. In general I am fine ...
1
vote
1answer
380 views

rm -rf / on a virtual machine?

So, this is probably a stupid question, but I'm genuinely interested. Would it be safe to recursively delete everything on a virtual machine from a command line, just for fun? I'd assume so, given ...
0
votes
0answers
62 views

How to delete a file named `aux` [duplicate]

I have a file named aux in a directory ...> ls aux ...> dir Wolumin w stacji C nie ma etykiety. Numer seryjny woluminu: ... Katalog: C:\Users\...\config 2015-07-15 23:14 <DIR> ...
1
vote
2answers
53 views

Deleting specific folders recursively

The folder structure is as below A/B/C1/ A/B/C2/ X/B/C1/ X/B/C2/ I want to delete all C2 folders however keep C1 intact. What is the correct command for that?
1
vote
2answers
86 views

How to delete all files and directory except one named directory from a specific folder in centos [duplicate]

I want to delete all files and directories from a specific directory except for one directory. For the same operation I had run this command # rm -R -df !(dir_name_not_to_delete) It works in Ubuntu ...