2022 Developer Survey is open! Take survey.

Questions tagged [rm]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
44 views

Which Linux shell command can completely remove a file from the system and make it unrecoverable?

Which Linux shell command can completely remove a file from the system and make it unrecoverable ? I have tied rm and shred but they have their limitations:- rm --help and see the information, you ...
user avatar
1 vote
2 answers
36 views

Prevent accidental use of rm

I was going to clean up a directory filled with write protected directories, so I elevated to root, and instead of running rm -rf * / I ran rm -rf /*. You can guess what happened. Is there a way this ...
user avatar
0 votes
1 answer
8 views

In Terminal, I can't remove Trashed Finder items deleted from other mounted volumes

The scenario is as follows. I run macOS A (APFS) which is an active partition. The macOS B&C (HFS+) are on mounted bootable volumes and visible while I'm working in macOS A. I can delete Finder ...
user avatar
  • 1
0 votes
0 answers
20 views

Can't Delete File With Single Quotes [duplicate]

I tried to compress a backup file via tar command on Linux (Oracle Enterprise Linux 8) but after the execution, i created a file named '--use-compress-program=pigz' by mistake. The problem is, i can't ...
user avatar
-3 votes
1 answer
30 views

Kali linux-Wiped entire file system accidentally [duplicate]

Something pretty bad just happened I was testing some build files I had made as root, and tried to delete the contents of one of the directories the script had made, but I forgot to move to it and ...
user avatar
0 votes
0 answers
62 views

Recover files deleted with rm under msys2

I was using a bash terminal under msys2. I have accidentally removed some user files with rm, under ~/MyDir. Do I have any higher chances of recovering them as compared to files removed with rm under ...
user avatar
0 votes
1 answer
310 views

Recovering deleted files deleted with Git Bash on Windows using rm -rf

While working in Git Bash on my Windows laptop, I accidently deleted important files and folders using rm -rf on C:>. Is there a way to restore them? Since the OS is Windows while tool is bash, ...
user avatar
  • 1
0 votes
2 answers
51 views

Can I let `rm` prompt again if I type the wrong key?

Question Is there any way to let rm -i just ask again if I type in anything different than j/J/n/N at its prompt? Reason Consider this small example: echo "Hey, I am a file. Or at least I am IN ...
user avatar
  • 1,261
0 votes
0 answers
33 views

Why MacOS Big Sur handling small files so badly

I am an Windows and Linux user, but recently I started working littlebit more with MacOS, because I need to build iOS apps and I found out a very big annoyance with newest MacOS Big Sur running on ...
user avatar
  • 113
0 votes
2 answers
51 views

How can i delete all files and directories on a USB stick

I use the c shell. I wish to remove all the files and directories from a USB stick There are a lot of files and directories. Many of the files and directories start with a period (I.e. they are so-...
user avatar
0 votes
1 answer
105 views

rm -rf no longer deletes folder in cron job

I wrote a program that writes a large number of small files to a temporary directory, then, via a call from within the program, deletes the temporary directory. This program is called via a user-...
user avatar
1 vote
1 answer
664 views

How to revert rm -rf in Mac OS X?

I was trying to run a set of commands (all starting with rm -rf) to completely remove an application in Mac OS X. All my folders in Desktop are accidentally removed somehow. Is there a way to bring ...
user avatar
  • 121
2 votes
1 answer
152 views

Linux (Pop_OS) Deleted File Without Proper Permissions?

The other day I was doing some clean up and decided to delete a log file that I had stuck in my development environment, and when I did, I started to think the permissions should not have let me, I ...
user avatar
  • 129
0 votes
1 answer
140 views

How to delete a hard link in a directory without write permissions?

I'm configuring a snapshot daily backup based on this recipe: http://www.mikerubel.org/computers/rsync_snapshots/ To summarize, on the backup server I rotate the older copies by running: dir=...
user avatar
0 votes
1 answer
194 views

How to remove the /snap directory?

I want to remove the snap directory: sudo rm -rfv /snap rm: cannot remove '/snap/*': Read-only file system Remount it as read and write. df /snap Filesystem 1K-blocks Used Available Use% ...
user avatar
  • 53
0 votes
2 answers
158 views

How to recover a deleted text file that is still open in vim?

I have text file that is still open in vim, but the original text file has been accidentally deleted. How can I recover it? The text file is still open in vim, so its original data is still stored in ...
user avatar
0 votes
0 answers
32 views

Cannot delete temporary file with extremely long name

I ran BleachBit for Linux on an external hard drive with the wipe-free-space function (empty space is overwritten with zeros) and for some reason the program crashed mid-course. It left over a ...
user avatar
  • 127
0 votes
1 answer
108 views

Exclamation Points - Is there a linux bash command to find and delete all directories named "!example" (and their contents)

I have searched and searched for an answer to this question, and I have used some of the answers I found in the past for finding and deleting large numbers of directories that are named by a certain ...
user avatar
  • 1
1 vote
1 answer
31 views

Is there any way to enable a backup of the current directory to take place when an rm command is issued?

I know how dangerous rm can be, and I'm unfortunately not a very responsible person at all. I know that I need to learn, but while I'm in the process, I need some help. Is there any way to create a ...
user avatar
1 vote
0 answers
90 views

Unable to delete hidden files starting with "._", containing special characters

The file name is ._03 Überlin.mp3, and it lives in a folder on a Western Digital NAS external drive, being accessed on a Mac: $ ls -al total 128 drwxrwxr-x@ 1 kraftydevil staff 264 Jul 23 03:58 . ...
user avatar
0 votes
0 answers
437 views

Operation not permitted

I am trying to delete files from trash on my MacBook. I have tried to remove with: sudo rm -rf /.Trash ~/.Trash Can not remove all files from Trash in OS X But I get Operation not permitted error ...
user avatar
  • 101
0 votes
1 answer
2k 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: ...
user avatar
  • 1
1 vote
1 answer
539 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 ...
user avatar
0 votes
2 answers
700 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. ...
user avatar
  • 111
0 votes
0 answers
174 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 ...
user avatar
  • 101
1 vote
1 answer
688 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 ...
user avatar
0 votes
0 answers
46 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 ...
user avatar
0 votes
1 answer
243 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 ...
user avatar
2 votes
2 answers
3k 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 ...
user avatar
1 vote
2 answers
73 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?
user avatar
  • 205
3 votes
2 answers
4k 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 ...
user avatar
1 vote
0 answers
1k 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 ...
user avatar
  • 457
0 votes
1 answer
70 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 -...
user avatar
  • 13
7 votes
5 answers
28k 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 ...
user avatar
6 votes
1 answer
11k 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 ...
user avatar
  • 238
1 vote
1 answer
2k 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. ...
user avatar
  • 139
1 vote
2 answers
1k 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' ...
user avatar
  • 262
0 votes
1 answer
40 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 ...
user avatar
2 votes
2 answers
5k 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 ...
user avatar
  • 639
1 vote
0 answers
3k 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 ?
user avatar
0 votes
1 answer
195 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. ...
user avatar
1 vote
1 answer
62 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 ...
user avatar
  • 305
4 votes
0 answers
5k 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/...
user avatar
1 vote
1 answer
236 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 -...
user avatar
  • 125
1 vote
0 answers
352 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 ...
user avatar
  • 111
7 votes
1 answer
7k 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 ...
user avatar
1 vote
2 answers
2k 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 ...
user avatar
0 votes
3 answers
3k 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
user avatar
0 votes
0 answers
531 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 ...
user avatar
  • 101
1 vote
1 answer
9k 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. ...
user avatar
  • 175

1
2 3 4 5