It’s dangerously easy to delete files using a command line on Terminal. But sometimes, this feature can become troublesome if you accidentally delete any important file or data.
If you have run into this problem and are looking for a solution online, then worry not, as you can still recover files deleted with RM command.
But first, let’s get to know more about the RM command.
Mac Terminal RM Command Breakdown
The Mac Terminal is one of the most powerful applications currently available on the macOS, as it can run, manage, and execute many life-saving commands.
Each of these commands comes with its own set of functionality and purpose. Therefore, before we explain how you can undo RM command, let us first study all the available RM commands and list their functions one by one.
Allows users to remove empty directories.
Prompts the users with a confirmation before deleting the desired file.
Deletes the respective files upon execution without any warnings.
Prompts the user with a single confirmation before deleting a group of files.
Deletes the respective directory and all its stored data.
Is it possible to Undo RM Command on a Mac?
Yes, it is possible to undo RM Command on Mac. When you delete a file using the RM command, even though you can’t find it on Trash, it doesn’t permanently erase the information. The original disk space it was occupying is marked as “ready to be overwritten” and the file will technically exist until it is overwritten with new data. So, the file can still be recovered with a little help.
Now there are a couple of methods available to get this job done, which include using third-party software or Mac’s original features. We are about to explain how to execute some of them down below:
How to Recover Files Permanently Deleted With RM Command on a Mac
If you do not have any backup, the best way to recover files deleted with RM command is with data recovery software tools. Many third-party applications allow users to get the job done without needing technical knowledge.
Disk Drill 5.0 is a reliable data recovery software available for Mac. It can efficiently recover 400+ file types, including documents, photos, videos, and archives. You can use this software to recover data even after emptying Trash, accidentally formatting storage devices, and of course, files that you deleted with the RM command.
Disk Drill has always been a top choice for data recovery, and here are some of the upgrades available on Disk Drill 5.0:
- Supports the latest macOS Ventura, and the new M1/M2 Macs
- Upgraded scanning speeds
- Straightforward user interface with dark mode support
- Market-leading recovery rates
- Can predict recovery chances
- Has file preview
Now let’s get started with Disk Drill:
- Head to the official website of Disk Drill to download the application. Once the download is completed, install it.
- Now open the Disk Drill application. Once you are on the main window, click on the Storage Devices tab from the left side panel.
- After this, select the respective storage device from which you want to recover the data. Click the Search for lost data button in the right panel of the window.
- Now, the software will initiate a scan to search for all the files, folders, and directories that have been deleted recently from your respective drive.
- After this, let the scanning process finish, and once it is done, press Review found items on the top-right corner of the window.
- Once you found the files deleted with the RM command on Mac, click on the left side box of all the individual files and click the Recover button to initiate recovery.
- Now, choose a destination for your recovered files.
- Once you have provided it, press OK to finish.
That’s it! You have successfully restored files deleted with RM.
How to Recover From RM Without Software
Now, if you don’t want to install third-party software, many other methods can still be implemented to recover deleted files on Mac without software.
Let’s check each of them out one at a time:
Method 1: Use Time Machine
One of the best features that Apple devices come with is its Time Machine app which allows its users to restore previous data via an existing Time Machine backup.
This is why Apple recommends that its users create Time Machine backups if they carry essential files on their devices. So in case, you have a previous backup, here are the steps that you can use to undo RM or restore lost data on your Mac using the Time Machine:
- On your Mac, click on the Apple menu and then select System Preferences. Once the new window opens, navigate to Time Machine and open it.
- Once opened, select Show Time machine in Menu Bar.
- Now press Enter Time Machine present on the top right corner of the Menu bar. Once done, navigate to all the individual files you wish to recover.
- Finally, click select the file and click the Restore button. Congrats! You were able to recover files deleted with RM on Mac successfully.
Method 2: Check iCloud Backup
Aside from Time Machine, there is another similar feature Apple provides known as iCloud, which allows users to keep their data safe and secure in cloud storage. It also enables them to back up huge chunks of their data and access it from anywhere in the world.
Although it has a limited free storage space, users can increase it according to their needs by paying a small fee. You can definitely count on iCloud to recover files deleted with RM command if you regularly backup your files. It is also one of the go-to methods to recover and restore any files that the users might have accidentally deleted by emptying trash on their Mac.
Here are the steps that you can use to restore RM files on your Mac.
- Go to www.iCloud.com and sign in to your account. This is usually the same as your Apple ID.
- Once opened, select iCloud Settings on the menu bar.
- Head to the Data Recovery section in the bottom right corner and click on Restore Files.
- Now select all the respective files that were deleted by RM command that you want to recover, and click on Restore.
That’s it! You successfully restored files deleted with RM command on your Mac using iCloud.
In addition to these two methods, here’s how you can recover deleted files using Mac Terminal.
In a nutshell, although various methods exist to undo RM commands on Mac, choose the method that suits you best. If you want to try a third-party application, Disk Drill is a reliable one. If you regularly do back ups, you can also try Time Machine and iCloud.
We hope that this article has helped you gain some clarity on the issue at hand and you were able to resolve your problem without any issues.
Mako is a freelance writer with a passion for all things Mac. Whether you're talking about the latest macOS updates, figuring out the best Mac programs, or need to know something from the Mac ecosystem—he's your guy. He's been writing about Macs for more than 4 years but has been using one for nearly a decade.
Andrey Vasilyev is an Editorial Advisor for Handy Recovery. Andrey is a software engineer expert with extensive expertise in data recovery, computer forensics, and data litigation. Andrey brings over 12 years of experience in software development, database administration, and hardware repair to the team.