Recover Deleted Files using Mac Terminal

If you are trying to recover deleted Files using the Mac Terminal, then this article is a must-read here you can learn how to use terminal commands to restore files and folders from the trash and also recover files in case of an emptied recycle bin, Follow the solutions to get back all data in simple clicks./p>

Written by John Harris / Updated on March 18, 2024

What is a Terminal?

The Terminal is a Command-line interface for your computer. It's a program that takes in commands, which it passes on to the computer's operating system to run. You can use the command line to delete files that cannot be removed by the delete option.

In some cases, you might delete the required files accidentally. In such cases the files will bypass the trash folder, so there is no chance of getting them back from the trash folder.

Note – When trying to recover deleted files, it is recommended to avoid using the computer or external drive until the required data has been recovered.

Can Files Deleted Using Terminal On Mac Be Recovered?

The answer is yes, in this section we have explained 3 ways on how to recover those files.

  1. Terminal Command (works if you have manually deleted files)
  2. Time Machine (only if you have backup)
  3. Recovering Data using a Data Recovery Software (go to option if everything else fails)

Method 1: Recover Deleted Files Using Terminal

Step 1: Launch Terminal on Mac

Step 2: Type cd. Trash command, hit Return

Step 3: In order to view the contents of the folder type Is -al ~/. Trash

Step 4: Type the name of your file mv filename../ (change file name with the full name of the file you have deleted), Hit Return button.

Step 5: Type mv filename ../destination (destination, where you want the file to be restored)

Step 6: Type Quit and hit Return.

Step 7: To verify if the files you want have been recovered or not. Open Finder, search the deleted files by entering their name in the search bar.

The drawback of the terminal is that you cannot recover files when the file name consists of hyphens or irregular symbols.

In case, you didn’t find the files you wanted to recover, you can use the next methods to retrieve those files back.

Method 2: Restore files from a backup using Time Machine

Time Machine is an in-built feature in your Mac system. Once you set the time machine and choose the backup Automatic option, the Time Machine regularly takes a backup of all files including music files, images, videos, documents, applications, emails, files, etc. One of the best features of Time Machine is it only backs up those files that were changed or modified since the previous backup.

Unchanged files will not be backed up, which makes the backup process faster and saves storage space.

Click here to learn more about Mac Time Machine

How to restore back up data.

Step 1: Connect your external storage device where you have stored your backup files to your Mac system.

Step 2: Launch Time Machine by Clicking on System Preferences option

Step 3: Find and Click on Time Machine icon.

Step 4: Check show time machine in the menu bar option, Time Machine icon will appear on your menu bar of your screen.

Step 5: Click on Enter Time Machine
Note: In case you know in which folder was the file previously stored. Click on that folder, then Click on Enter Time Machine.

Step 6: Find the files that you want to recover, then Click on Restore button.

As discussed earlier this method only works if you have a backup, in case you don’t have a backup or this method failed to recover your files. We highly recommend you Use the next method.

Method 3: Recover Deleted files using Data Recovery Tool

Remo Recover is a go-to data recovery software when you can’t locate the files on Trash or don’t have a backup of the data.

The software is built robust with an easy-to-use interface which makes the recovery look effortless, You can recover data from a Mac hard drive and other storage devices with just simple clicks.

Even, files deleted using RM command and Command Delete keys can be restored with utmost ease.

Steps to Recover Deleted files On Mac using Remo Recover

Step 1: Download and launch Remo Recover Mac on your system.

Step 2: Then, select the volume or drive and click on Scan to begin recovering deleted files on Mac.

select the volume or drive and click on Scan

Step 3: Click on Dynamic Recovery View to see the files being recovered form the Mac.

view the initally recovered files after QuickScan

Step 4: Make use of features like Advanced Scan or Search Bar to sort the recovered files from the drive easily.

sort the recovered files

Step 5: Double-click on any file to preview the recovered files.

preview recovered files

Step 6: Preview the files you wish to restore, select them, and then click Restore to save the files to your preferred location.

recover the files from the tool

NOTE: Make sure to save the recovered files in a safe location, preferably in a new location to avoid losing them again.

Precautionary Measures to Keep Your Data Safe on Mac Devices

Follow these simple steps to avoid losing files on your Mac devices:

Backup Regularly: Take periodic backups of important data. Choose either Time Machine or iCloud as a backup to your important files.

Use an Antivirus: Scan your device using a reliable third-party antivirus tool to keep it safe from viruses and malware attacks damaging or deleting the file.

Data Encryption: Use FileVault to encrypt the hard drive to prevent unauthorized access to the data.

Update: Keep your macOS up to date, to ensure that you have all the updated security patches and bug fixes.

Conclusion:

In this article, we have talked about how to use Terminal commands to recover deleted files on a mac computer additionally, how to use Time Machine to recover files from a backup.

If no options left for you, use Remo Recover to get back all the deleted and lost files from your device with simple clicks.

Frequently Asked Questions

To recover accidentally deleted files, Open Trash, locate the files select them, right-click, and choose the Put back option to restore the deleted files.

To recover permanently deleted files on Mac devices, stop using the device and install any reliable data recovery tool like Remo Recover to get back all the data.

Yes, you can recover permanently deleted folders using data recovery software and data recovery services.

Why Choose Remo?

100% safeSecure

100% SatisfactionGuarantee

10 Million+Downloads

Free TechSupport

Live Chat24/7 Support

Top