Table of Contents

Quick Navigation:

To permanently remove a file from your computer, use the RM command. Backing up your Mac's contents is essential if you accidentally delete a critical document using the RM command. You also can recover RM command deleted files using data recovery software or a backup.

If you've accidentally erased a file on a Mac, you may get it back with the help of Mac data recovery software. Users can scan and potentially recover RM-deleted files with its assistance. Once it locates the files that RM has erased, it can sort them into the appropriate categories. Files erased by RM can be recovered after being previewed in this fashion.

Can data that was erased with rm be restored?

When files are destroyed with the 'rm' command, they are permanently removed from the system rather than moved to the Trash. Only references to files are erased when you delete them. The actual file will remain on the disk. Therefore, you should not utilize the disk again after using the rm command to delete data. If you do this, new data will be written over the deleted one, making it permanently unrecoverable.

How does RM Command work?

Using the RM command in Mac Terminal to delete files permanently is a breeze. The RM command can help you delete files even if they are locked, the Trash is full, or you don't have the appropriate permissions. However, files are gone for good when they are erased using the RM command. First, we'll examine the RM command and how it facilitates deletion.

Take the case of a film entitled TrashDocument.rtf that you don't want to see again on your Macintosh computer; to delete it, type Rm TrashDocument.rtf. After the file is deleted, it will no longer be in storage. The rm -R Archives command line, however, will delete not only the file but also its parent directory and any other archives that contain files and sub-directories.

recovering deleted files with RM command

How to recover RM deleted files on Mac?

Because the RM command is so potent, you'll need to rely on backups or utilize a third-party application called Do Your Data Recovery software to retrieve your files directly from the file system if you've accidentally removed them from the terminal. And as we indicated up top, time is of the essence; every passing minute can eat away at your lost data.

Method 1: Use data recovery software to recover lost files

If you've accidentally deleted important files from your Mac, you can get them back using a data recovery application. Even though there aren't many choices, several reliable data recovery apps are available, and Do Your Data Recovery for Mac is one of them.

Do Your Data Recovery for Mac

  • Recover RM deleted files on Mac.
  • Recover erased or formatted data on Mac.
  • Recover inaccessible or overwritten data on Mac.

Step 1. Download and install Do Your Data Recovery for Mac and run it from Launchpad. To recover deleted files, select the Mac disk to start data recovery.

Recover Deleted Files With RM Command on Mac

Step 2. The Scan button may be found in the lower-right corner of the screen, and selecting it will begin a scan.

Recover Deleted Files With RM Command on Mac

Step 3. Once the scan is completed, you can preview all recoverable files. Select the wanted files and save them by clicking on Recover button.

Recover Deleted Files With RM Command on Mac

Method 2: Restore lost files from Time Machine Backup

Time Machine creates "snapshots" of your current file and folder structures and saves them. If you have a Time Machine backup from before you used the RM command to remove your data, you can restore a previous version of your files.

Using Time Machine, you can get back your RM data by doing the following:

Step 1. First, provide a stable connection between your computer and the Time Machine backup drive. Then, navigate to Time Machine within System Preferences or System Settings.

Step 2. The second step is to select the "Show Time Machine in the menu bar" option before closing the current window.

Step 3. Launch Finder and navigate where you wish to retrieve files. Select Apple > Time Machine > Enter Time Machine from the main menu.

recovering deleted files with RM command

Step 4. Use the buttons on the right side of the main window to navigate to the backup that contains the files you just removed. Select the files to restore, then click the Restore button.

recovering deleted files with RM command

FAQs about recovering deleted files with RM command

Yes, the deleted files are not lost permanently. Download a data recovery application to scan the Mac hard drive and recover the deleted files. You’d better stop using your Mac before get the deleted files back.

The files are deleted by RM command will not be moved to the Trash, they just disappear from the Mac hard drive. But they are not lost permanently, and can be recovered by data recovery software, such as Do Your Data Recovery for Mac.

You can use data erasure software, such as DoYourData Super Eraser for Mac to help you securely and permanently delete files or folders on Mac to make data recover be impossible.


Although the RM command may permanently wipe files, restoring them with reliable data recovery software is still possible. Being user-friendly and secure, it has a good track record. With data recovery software or Time Machine backup, you will recover deleted files with RM command.

DoYourData Author

Written & Updated by Justin Kenny

Justin Kenny is a writer & editor of DoYourData. He joined DoYourData in 2016 and focuses on writing articles about Windows data recovery, Mac data recovery, external device data recovery, hard drive clone, data erasure, Mac cleanup, computer issue fixes, etc. He is a super fan of Apple devices and is big on testing new digital device and system utility software.

Read full bio