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

1
vote
0answers
27 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
86 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. ...
0
votes
1answer
36 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
245 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.pliston macOS 10.13.1:bash-3.2# rm -f /Library/LaunchAgents/com.mcafee.reporter.plistrm: /Library/...
1
vote
1answer
42 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 eachfind . -name $name -type d -exec rm -...
1
vote
1answer
76 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
2k 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.yamldrwxr-xr-x 5 hjpotter92 hjpotter92 4.0K Sep 12 19:40 templates/-rw-r--r-- 1 root root ...
0
votes
2answers
166 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
121 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
62 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 ...
0
votes
1answer
453 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.pyI tried to remove the file but it won't work....
0
votes
1answer
319 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.
-1
votes
1answer
563 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?
0
votes
0answers
76 views

How to change the permission of files older than x days in unix? all at same time?

I have below command to remove files older than 'x' days:find /var/mqm/errors -mtime +20 -exec rm {} \;how can i use similar code to change the permission of those files to chmod 777
4
votes
1answer
2k 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
76 views

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

git status shows:Untracked files: (use "git add ..." to include in what will becommitted)"\032"ls shows that folder as ?I've tried:$ rm "\032"rm: cannot remove '\032': ...
1
vote
1answer
265 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
697 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
262 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
58 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
64 views

Efficient `rm` of hard links?

Suppose these is a file foo. Then, suppose I create a hard link:ln foo barI 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
584 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....
5
votes
3answers
7k 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
74 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 http://superuser.com/.Trashes/rm: http://superuser.com/.Trashes//503/c/c: Directory not empty...
0
votes
2answers
7k views

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

From manual:-f, --forceignore nonexistent files, never prompt-r, -R, --recursiveremove the contents of directories recursivelyThough this options description is different, when trying to ...
1
vote
1answer
77 views

Unable to rm -rf .nfs0000000008547f6500007f62 file on linux server

When I do arm -rf directoryIt says a message like :rm: can't delete directory/.nfs0000000008547f6500007f62ressource occupied and I don't know why.
0
votes
1answer
51 views

How to remove file on Linux with ? in name

Cannot move or remove file with ? in name. Any ideas? Have tried the following:# lsmanager?%80%99s-viewpoint.html what-wcsap-can-offer-you-?%80%93-guide-new-directors.html# mv manager\?%80%99s-...
0
votes
0answers
458 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
190 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.appapp/publicapp/public/uploads...
1
vote
2answers
378 views

Root user can't remove folder

There is a folder /mnt/shared which root user can't access/modify or remove. # ls -lai /mnttotal 416662 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
86 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-diruser@mycomputer:~$ ls -l /backup-dir/total 10102784drwxrwxrwx 1 ...
0
votes
1answer
1k 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.gzI want to keep name_$(date +\01\%m\%Y).tar.gzI want something ...
1
vote
1answer
49 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
74 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 filesrv106@storage10:~$ rm -vf /srv/storage/homes/srv106/daily/files/daily.32/root/.my.cnfrm: cannot remove `/srv/storage/...
-1
votes
3answers
125 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
908 views

How to kill/rm pipe by inode number only?

EDIT: I originally cut and pasted a question I'd asked earlier onstackoverflow that got closed:https://stackoverflow.com/questions/32622224/how-to-kill-pipe-by-inode-number-onlyI've now run into ...
-3
votes
1answer
730 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
67 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
144 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
295 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
18 views

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

I have a file named aux in a directory...> lsaux...> dirWolumin w stacji C nie ma etykiety.Numer seryjny woluminu: ...Katalog: C:\Users\...\config2015-07-15 23:14 <DIR> ...
1
vote
2answers
51 views

Deleting specific folders recursively

The folder structure is as belowA/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
60 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 ...
0
votes
2answers
124 views

understanding the -R flag and * in rm commands

When using the rm command in OS X 10.9 I accidentally deleted an entire disk. As I understand the command I used: sudo rm -Rfv /Volumes/Disk/AppName\!\ Whatever\ X.app/Contents/Resources/*...
1
vote
2answers
52 views

Recover Partitions deleted by rm

In my PC I have 3 NTFS partitions1 for Windows Boot Loader, next one is windows installation directory and the last one is for storing my whole data.They were mounted like this/dev/sda1=> /mnt/...
0
votes
2answers
665 views

What is the command to remove all files and folders, on mac os x terminal?

On Mac OS X terminal, how can we remove all files and folders, including hidden ones, recursively, except one directory?Thank you.
1
vote
1answer
91 views

Accidentally deleted all files older than 7 days

A bad written skript located in /etc/cron.daily erroneously executed find * -mtime +7 -exec rm -r {} \; as root user. As a result of this I can no longer login. Beside that the system seems to run ...
2
votes
2answers
1k views

How to recursivly delete all JPG files, but keep the ones containing “sample”

How can I find and delete all the .jpg files in a directory tree with the exception of the ones containing "sample" in their filename?For example : a.zip -> keep it b.jpg -...
1
vote
1answer
841 views

Can't rm or cd into directory [duplicate]

I found a directory on my machine called "Previous System" that looked old and useless and I tried to delete by dragging to the trash and emptying the trash. That failed to delete the directory, ...
0
votes
2answers
1k views

Delete All Files Older Than Specified Time Within A Directory (Ubuntu)

I have a bunch of files in a directory with all different names and I want to delete all that are older than a specified time. Example:File1File2File3File1 was made Mar 31 08:00File2 was made ...

153050per page