How to Recover Deleted Files Using Mac Terminal: Proven Method

How to Recover Deleted Files Using Mac Terminal: Proven Method

Did you lose your important files from your Mac computer? Well, one of the common issues in the life of a Mac user. Read on to know about how to recover deleted files with Mac terminal.

Wondershare Recoverit Authors

Dec 21, 2020 • Filed to: Recover & Repair Files • Proven solutions


It's very common to accidentally delete a file that you only get to realize about the mistake later. While sometimes it happens as a mistake while the other times, some external cause factor results in the deletion of files. Whatever the reason might be, you will always want to recover them back anyhow.

Now, speaking of recovering deleted photos, numerous ways can be used to recover deleted files on Mac. The article focuses on how to recover deleted files on Mac using a terminal. It also features alternative ways to recover deleted files using a data recovery software application and other effective methods.

Part 1: How to Recover Your Deleted Files Using Mac Terminal

Mac terminal is a powerful program that comes as an in-built feature in all Mac OS computers. The command-line interface is located in the Mac utility folders and serves as a gateway to UNIX. You can bet on the command line in the Mac terminal if you are looking for an efficient method to recover deleted files on Mac.

But before we learn about this method, there is something you should know that may help you recover deleted data much efficiently. Now, you have drag & drop the files to the trash folder or accidentally pressed on the 'Delete' key. But these files might still be in the Trash folder. If that's what the case is, you can click on 'Control + Z' to undo the deletion of files. Moreover, you can also go to the trash folder and restore those files.

Follow the process below to recover deleted files using Mac Terminal.

Step 1: Click on the ‘Finder’ and tap on the ‘Applications’ option.

Step 2: Navigate to the ‘Utilities’ tab and double-tap on the ‘Terminal.’

terminal highlighted

Step 3: Write ‘cd.trash’ and click on ‘Return.’

Step 4: Now, type ‘mv youfilename..’ and click on the 'Return' tab.

Step 5: Write ‘Quit’ in the command line to quit the terminal window.

Step 6: Now, navigate to ‘Finder’ on the Mac and enter the file name in the search bar you wanted to recover.

Step 7: You might be able to see the recovered files. Move it to a location different from the previous one.

Part 2: Alternative Way to Recover Deleted Files on Mac

Although the Mac terminal method serves as the best way to restore a deleted file, you can also use some other alternatives. Here are two of the significant ways that work best to recover deleted files from Mac computer.

1. Restore with time machine Backup on Mac

Apple has another built-in feature named Time Machine that helps to backup Mac data. It works best to recover all types of files from photos, videos, apps, music to emails, and system files. So, if you let it turned on in the settings, it can automatically create backups on your Mac computer. Whether you want hourly, daily, or weekly backups, it allows you to backup as per your requirements.

Follow the process mentioned below to recovering deleted files on Mac.

Step 1: Click on the ‘System Preferences’ from the menu.

system preference highlighted

Step 2: Now, tap on the 'Time Machine' option.

Step 3: Click on the box next to ‘Show Time Machine’ in the menu bar.

Step 4: Now, tap on the 'Time Machine' icon, followed by the 'Enter Time Machine' tab.

time machine

Step 5: Locate the deleted file that you wanted to restore and tap on ‘Restore.’

The above process will copy the deleted file back to its position.

2. Using Recoverit Data Recovery for Mac

Although you can also use numerous efficient ways to recover deleted files from a Mac computer, you can also use application software for the job. Speaking of a free program or software, Recoverit is one of the reliable ways to go for. It serves best to recover all formats of files, whether it’s audio, video, pdf, jpg, gif, or more.

Here are some of Recoverit software features that make it stand out from the rest of the data recovery software.

Now, to recover the deleted files from the Mac computer, you must download & install the Recoverit application as the application is successfully installed and downloaded, double-tap on the Recoverit data recovery software to initiate the process.

If you couldn’t find the application icon on the desktop, then follow the steps mentioned below.

Step 1: Click on the ‘Finder’ tab and navigate to the ‘Applications’ option.

Step 2: Locate ‘Recoverit’ from the list and double-tap on the software.

Now, follow the steps mentioned below to recover deleted files from Mac computer.

Step 1: Select a Location

Under the ‘Select Location’ tab, pick a location from where you want to recover deleted files from. If you know the specific path of the lost path, you can choose ‘Select Folder’ under the ‘Select Location’ option.

Now, tap on the ‘Start’ button to start the process.

mac data recovery

Step 2: Scan the Location

With the help of its advanced searching algorithm, Recoverit will start a thorough scan of all the lost or deleted files. Now, if you find the file that you were looking for, you can stop the scanning process anytime in the middle of scanning.

mac scanning lost files

Step 3: Preview and Recover

As Recoverit allows its users to preview the recoverable files, you can get a glimpse of the deleted files before proceeding to the recovering step. Moreover, you can be sure if it is the file that you wanted to recover. Once you got the files that you were looking for, tap on the ‘Recover’ option.

Tip: While selecting the path of the recovered files, make sure you do not save them to the path you lost in the first place.

mac photo recovery

The Bottom Line

If you think that your accidental mistake on your Mac computer has cost you all the data, think again! The inbuilt features in a Mac OS work best to recover deleted files. You can also use Recoverit data recovery software to recover all the deleted files from any specific location on your hard drive on a Mac.

Recoverit author

Amy Dennis

staff Editor

(Click to rate this post)

Generally rated4.5(105participated)

Home > Resources > Recover & Repair Files > How to Recover Deleted Files Using Mac Terminal: Proven Method