How to Recover Deleted Files on Mac using Terminal

facebook twitter Updated on Nov 18, 2020

You can always see people are asking the same question as "how do you undo a delete in the terminal?", "How to recover deleted files on Mac with terminal?", "how to do file recovery on Mac via terminal". For some people with computer techniques, it’s very easy for them to make use of terminal to recover deleted files on Mac. However, people who do not know much about computer, they do not know to put their hands on it at all. Here in the following, we’re going to talk about how to recover deleted files on Mac using terminal.

Step 1: Go to "Finder" > "Applications" > "Utilities" and command click "Terminal" to launch it.

Step 2: Type "cd.Trash" and click "Return" start to Mac recover files deleted from terminal.

Step 3: Type "mv filename ../" and click "Return". Please replace the filename with the full name of the file you want to recover on Mac via terminal.

recover deleted files on mac using terminal

Step 4: Type Quit to exit the Terminal program.

Step 5. Now you can go to the previous folder to check out whether the deleted file is there or not. Another way to check out whether the deleted file is recovered by Terminal or not is by using the Spotlight to search for the deleted file on the right side of the Mac window. Just click it and type in the file name in the search box and click "Search".

If you can recover deleted file from terminal, it is great! And I have to say "congratulation". However, not all people can recover deleted files in macOS due to all kinds of reasons, like empty the trash bin, deleted the files with Shift and Command key. In this case, I have to suggest you using software to recover deleted files on Mac as soon as possible. Otherwise, you may lose the files permanently.

Failed to recover deleted files on Mac with Terminal. Is there any better way to recover these files?

A Comprehensive Solution to Recover Deleted Files on Mac Without Terminal

OK, the best and most efficient way to recover lost, deleted or even Shift Command deleted files is to use data recovery software. There are some options available over the internet, but not at the Apple Store. Apple does not allow any such kind of software workable at its official store. In this case, you have to find a trustworthy one by yourself. Here I’d like to recommend one of the well-known software named is iBeesoft Data Recovery for Mac. It covers almost all the features one needs to recover permanently deleted files on Mac.

Your Safe & Best File Recovery Software for Mac

recover deleted files on mac terminal
  • Support recovering all the commonly used file types, including videos, pictures, audio files, emails, documents and more.
  • Powerful recovery ability: whether you lost the files due to clear trash, format drive, system crash, computer power off, unsaved the files, or delete accidentally or purposely, it can find the files for you.
  • Simplified interface with no jargon, very friendly for individuals who do not know how to recover data with computer techniques.
  • Compared with recovering deleted files on Mac, it is much easier to operate. Follow the navigation and wait, then it is done.
file recovery mac terminal

Here in the following are the guidelines for how to recover deleted files on Mac if you fail to recover deleted files using Terminal on Mac.

Step 1. Install deleted file recovery software on Mac

First, download and install the data recovery software on your Mac. It’s fully compatible with all versions of macOS, including the latest macOS Mojave running on MacBook Pro, MacBook Air, or iMac. Feel free to install and use it on your Mac.

Step 2. Select deleted file types to recover

After installing the software on your Mac, launch it right away. After then, you can see all supported files are selected in the start-up window. From there, you need to make sure what kind of type the deleted files belong to. After the, to save your time for the scanning process, you can untick other types of files, only selecting the needed one. Click "Start" to search and recover deleted items on Mac. If you don’t mind letting the software scanning for other delete file types as well, ignore it and directly click "Start".

how to recover deleted files mac terminal

Step 3. Locate where the deleted files were on Mac

Next, in the new window, please select the hard drive from the drive list. If you want to recover the files from external hard drive on Mac, you can connect it with your Mac and select it in the step. Click "Scan".

mac recover files deleted from terminal

Step 4. Recover Deleted files on Mac

There is a progress bar, telling you how it goes on with the data recovery process. For sure, if you see the target files are found, you can stop the scanning process and preview the found files. If you are not sure whether all files are found, let it finish the whole scanning process. After that, you can see all found files are sorted into categories. Click the left panel to filter file types and check out the details on the right side. When find the deleted files, select them and click "Recover" to save them on your computer.

recover deleted files mac os x terminal

The "Deep Scan" option in the result window will let you scan your Mac again, but find more files for you. You can try your luck to see what kind of extra files it can find for you.

Related Articles