Questions tagged [rm]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
25 views

How to delete locked app on MacOS (Catalina)

I'm trying to delete a locked app on Catalina. In recovery mode, I disabled SIP, restarted and gave Terminal Full Disk Access. Tried this: /Volumes/Macintosh\ HD/Applications/Crashplan.app: ...
1
vote
1answer
27 views

Can't delete, chown or chmod file even as root

I want to delete a backup of a website (FTP-mirrored with wget), but a single file, named js_composer.less resists. I can create new files and delete them in the same directory, so the problem might ...
0
votes
2answers
41 views

rm -rf foo_dir takes a long time

I have a directory ./aggregated/ in which I have 7550 sub-dirs each containing 250 files. aggregated has 5.5GB in total. I've tried deleting aggregated via rm -rf aggregated and it is taking hours. ...
0
votes
0answers
65 views

How to remove file with hard link 0

I've tried to remove linux files from windows but they hadn't been deleted. I tried to remove from Ubuntu terminal but get "permission denied" I set chown $USER:$USER and chmod 777 for parent ...
1
vote
1answer
38 views

How to delete a large number of temporary files on my external hard drive?

I'm currently processing a series of large data files (150+ GB) on my home laptop (a 2015 MacBook running MacOS Catalina 10.15.3). I ran into the issue where a particular program wouldn't finish ...
0
votes
0answers
18 views

Deleting Files and directories on a Solid State Drive (fdisk, dd, rm)

I have been reading for a while on how rm, fdisk and dd work. I wasn't able to fully understand their source code however. Let's assume I would like to delete my /dev/nvme0n1p3 partition and the files ...
0
votes
1answer
54 views

I accidentally ran `rm -rf /` what should I do

I accidentally ran rm -rf / on my macos machine, most files were protected since I was not running the command as root, but I definitely lost some files in /usr/local, are there any other files I ...
2
votes
2answers
253 views

Bash Script to delete oldest files but keep latest files including sub-directories

I'm trying to delete old files but should keep latest 3 days log files.i tried below command, ls -tr /home/httpd/htdocs/pathname/pathname/config//build/logs/apps/.log | tail -n +4 | xargs rm -- but ...
0
votes
0answers
190 views

Accidentally used rm -r * on a directory on MAC Sierra - best tools for recovery?

I just did something insanely stupid. I ran rm -r * somedirectory where I meant to delete just the contents of the folder somedirectory. The directory was for my website. Everything under /Library/...
1
vote
2answers
54 views

Deletion behavior of rm *

If I execute rm * within a directory containing files, are only files in this directory deleted? Or does the asterisk include the filesystem root / as well?
3
votes
2answers
552 views

How to delete a directory in MacOS from the command line?

I would like to know how to delete a directory on my MacBook. I have tried several methods such as moving it to the Trash -> Empty Trash, via the command sudo rm -rf, restarting the computer in ...
0
votes
0answers
133 views

Can't delete the file with rm command

I have a file which can't deleted by rm. /var/www/html/symfony4proj/var/cache/pool/+m7exph6c3/X/3/tCcgRMw5TEmYO-kHpJ0t file satus -rw-r--r-- 1 app app 2781 Jan 1 1970 tCcgRMw5TEmYO-kHpJ0t Change ...
0
votes
1answer
58 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 -...
5
votes
5answers
15k 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 ...
5
votes
1answer
4k 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
881 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
588 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
36 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 ...
2
votes
2answers
3k 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
245 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
170 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
55 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 ...
3
votes
0answers
4k 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
168 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
0answers
262 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
5k 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
1k 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
1k 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
300 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
6k 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
2k 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?
3
votes
1answer
9k 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
183 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
1k 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
2k 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
783 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
70 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
233 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 ...
4
votes
2answers
2k 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
9k 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
133 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
17k 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
217 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
70 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-...
1
vote
0answers
1k 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
1k 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
796 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
213 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
4k 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
2 3 4 5