How to Restore Files Deleted from Trash by Using Terminal? Myth Busting Blog

Untitled Document

Summary: This blog busts the myth that Terminal can recover your permanently deleted files from Trash. You’ll learn the following:

1. The process to restore files deleted from Trash by using Terminal
2. Situations wherein Terminal can’t recover your deleted files
3. Mac data recovery software to recover data lost from Trash

Download the free-to-try Mac data recovery software to recover your files deleted from Trash.

Free-Download-Mac


When you select one or more files, then drag and drop them to Trash, hit the Command + Delete hotkey, or secondary-click and choose the Move to Trash option, macOS deletes those files instantly from the current folder and keeps their references in Trash.

You can straightaway use Command + Z key to undo the delete operation. Otherwise, later you can go to Trash, select those deleted files, secondary click, and choose Put Back to restore the files from the Trash to their original location.

But that’s not the only way to restore your files from Trash. You can use Terminal to perform the same task. The next section describes the method in detail.

1. The process to restore files deleted from Trash by using Terminal

You can perform the file restoration task by using the macOS Terminal. The steps are as follows:

Trash file recovery
  1. Go to Applications > Utilities > Terminal to open the Terminal app.
  2. In the command line, type cd.Trash to change the directory to the hidden Trash folder.
  3. Type ls command to list all files in the Trash folder.
  4. Type mv <filename> ../ command to move the specified file to the home directory. Here, replace the filename with the name of the deleted file present inside Trash.
  5. Navigate to the home directory to access your restored file.

2. Situations wherein Terminal can’t recover your deleted files

Terminal can’t help you to restore your deleted files when the references of the files are lost from the Trash folder. These references could get lost in the following situations:

  • When you Empty Trash
  • Delete files from Trash by using Delete Immediately option
  • Press Option + Shift + Command + Delete keys

This debunks the myth that Terminal can recover permanently deleted files from Trash.

3. Mac data recovery software to recover data lost from Trash

When you lose the references of your deleted files from Trash, macOS doesn’t remove the files permanently from the Mac storage drive. Instead, the files remain in the storage medium in an inaccessible state. Only a professional Mac data recovery software can scan the entire storage device based on file signatures and retrieve the inaccessible files.

Steps to recover data lost from Trash are as follows:

Step 1: Disable system integrity protection

In the case of macOS Catalina, Mojave, or High Sierra, to scan and recover permanently deleted data from the startup disk, disable the system integrity protection of your Mac by using Terminal.

Disable or enable System Integrity Protection
  1. Start or restart your Mac and quickly press & hold Command + R keys. Release the keys when the Apple logo appears. Your Mac boots into macOS Recovery mode.
  2. From the Menu Bar, go to Utilities > Terminal to open the Terminal app.
  3. On the command line, type csrutil disable and hit Return. Your Mac disables the system integrity protection.
  4. Restart your Mac from the Apple menu and let it boot normally.

Step 2: Recover the data lost from Trash

Step 1. Download and install the *trial version of Stellar Data Recovery Professional for Mac on your MacBook, iMac, or Mac mini wherein data loss occurred.

mac-free-download

Step 2. From the Select What To Recover screen, select the type of data that you’ve lost from the Trash folder and click Next.

Step 3. From the Select Location screen, select Macintosh HD, the startup disk, wherein the Trash folder is present. Toggle on Deep Scan, then click Scan.

Step 4. Click the Deleted List tab, preview and select the required deleted files, then click Recover. Click Browse to specify a distinct save destination, then click Save.

*Trial version of Stellar Data Recovery Professional for Mac allows free scan and preview but needs activation to recover data. The software has a 30-day money-back guarantee, just in case.

Step 3: Enable system integrity protection

  1. Once the recovery process is over, enable the system integrity protection by using Terminal in the same way mentioned before.
  2. Boot into macOS recovery mode and launch Terminal. Type csrutil enable and hit Return. Restart your Mac from the Apple menu and let it boot normally.

For clarity, watch the video on how to restore files deleted from Trash by using Stellar Data Recovery Professional for Mac.

Conclusion

The blog debunked the myth that Terminal can restore the files that are deleted from Trash. In reality, it restores only those deleted files that are present in the Trash. In case you have emptied your Trash folder or deleted files from the Trash, then Terminal data recovery is useless. You would need a Mac data recovery software to get back your permanently deleted data.

Stellar Data Recovery Professional for Mac is a widely used software for recovering permanently deleted files from Trash. The software recovers data on all types of Mac devices viz. MacBook Air, MacBook Pro, iMac, iMac Pro, Mac Pro, and Mac mini. Try it now to retrieve your Trash emptied data, and avert the situation wherein the software can’t recover data due to overwriting.

Comments(4)
  1. Kirk Fletcher August 23, 2019
    • Vishal August 27, 2019
  2. Carolyn Cunningham January 24, 2019
    • Vishal January 25, 2019

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.