Undo RM Command Mac

How to Recover Files Deleted With RM Command on a Mac

Last updated:

No robots used, our articles are crafted by humans under strict Editorial Guidelines.

Written by Mako Young Mako Young Contributing Writer • 19 articles Mako Young, also known as J. Robertson Macaulay Young, is a contributing writer for Handy Recovery, having fully joined the project in early 2022 as a macOS expert, a title he continues to hold up to date. Since then, he has been dedicated to creating data recovery and storage optimization guides for Apple devices. LinkedIn Approved by Andrey Vasilyev Andrey Vasilyev Editor 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. LinkedIn

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.

RM Commands



Allows users to remove empty directories.

rm -i

Prompts the users with a confirmation before deleting the desired file.

rm -f

Deletes the respective files upon execution without any warnings.

rm -l

Prompts the user with a single confirmation before deleting a group of files.

rm -r

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:

  1. Head to the official website of Disk Drill to download the application. Once the download is completed, install it. downloading disk drill
  2. Now open the Disk Drill application. Once you are on the main window, click on the Storage Devices tab from the left side panel. storage device
  3. 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. search lost for data
  4. 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. initiating a scan
  5. After this, let the scanning process finish, and once it is done, press Review found items on the top-right corner of the window. review found items
  6. 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. recover a file
  7. Now, choose a destination for your recovered files.
  8. 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:

  1. 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. navigating time machine
  2. Once opened, select Show Time machine in Menu Bar. show time machine menu bar
  3. Now press Enter Time Machine present on the top right corner of the Menu bar. enter time machineOnce done, navigate to all the individual files you wish to recover.
  4. Finally, click select the file and click the Restore button. restore a fileCongrats! 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.

  1. Go to www.iCloud.com and sign in to your account. This is usually the same as your Apple ID. sign in icloud account
  2. Once opened, select iCloud Settings on the menu bar. icloud settings
  3. Head to the Data Recovery section in the bottom right corner and click on Restore Files. restoring a files
  4. 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.


The RM command allows users to remove any unnecessary unneeded files, folders, and directories from their system. Unlike the normal delete feature, the RM command doesn’t move any file to Trash.

The RM command can remove any specific file or group of files from a list within a directory. Once you confirm the prompt, it can remove any file from a directory without leaving a recovery option via the Trash folder.

Yes. There are quite a few methods that allow users to recover files deleted from the rm command. Some include using a third-party application like Disk Drill, while others can be executed using Mac’s Time Machine or checking your iCloud backup.

You can quickly recover files deleted from RM command using the following steps:

  1. Download, install and run the Disk Drill on your Mac.
  2. Click the respective drive and press Search for lost data.
  3. Select the files deleted with RM.
  4. Hit Recover and wait for the recovery process to finish.


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.

About article
Contributing Writer Mako Young

This article was written by Mako Young, a Contributing Writer at Handy Recovery Advisor. It was also verified for technical accuracy by Andrey Vasilyev, our editorial advisor.

Curious about our content creation process? Take a look at our Editor Guidelines.

How do you rate the article? Submitted: