Table of Content
    Mac Data Recovery

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


    Table of Content

      Summary: This blog busts the myth that Terminal can recover permanently deleted files from Trash. Instead download the free Mac data recovery software to recover files deleted from Trash.

      Introduction

      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.

      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.

      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.

      best-mac-data-recovery-software-banner

      Recover Data Using Free Mac Data Recovery software

      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 free Mac data recovery software can scan the entire storage device based on file signatures and retrieve the inaccessible files.

      Step 1. Download and install the *trial version of Stellar Data Recovery Free Edition 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.

      Stellar

      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.

      Stellar

      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.

      Stellar

      *Trial version of Stellar Data Recovery Free Edition for Mac allows free scan, preview, and up to 1 Gb of free data recovery. For unlimited data recovery, you can upgrade the software to a higher version.

      Watch the video on how to restore files deleted from Trash by using Stellar Data Recovery software.

      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 Free Edition 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.

      Was this article helpful?

      No NO

      About The Author

      Vishal linkdin

      Vishal is a data recovery expert @Stellar. He addresses data loss scenarios on a Mac. He intends to help people solve their macOS problems. Besides, Vishal prefers to read about astronomy and autobiography, and his favorite is Steve Jobs - The man who thought different written by Karen Bluementhal.

      8 comments

      1. If you really are in a situation where you have deleted some things and need to recover them, then you should decidedly *NOT* go and download any recovery software to the same hard drive. By doing so, you run the very real risk of the OS reusing in part or whole the hard disk blocks that were formerly designated for your file(s) you intend to recover. In other words, by downloading recovery software, or downloading _anything_ really, to the hard disk you wish to recover from, you are at high risk for irrevocably destroying files you would have liked to recover.

        Instead, what you need to do is either 1) have this software already installed and sitting dormant on your hard drive for the time you might need it (i.e. before you’re in the lost file situation), or 2) esp. if it’s too late and you’ve already lost files, download the recovery software to a different hard drive, USB flash drive, etc. and run it from that location.

        1. Thank you for your insightful comment, Victor. You make a great point about the importance of not downloading recovery software to the same hard drive from which
          you wish to recover lost data. As you rightly mentioned, doing so can increase the risk of permanently overwriting the deleted files.

          The article primarily focuses on using the Mac Terminal to recover lost data, and it does mention the importance of avoiding any actions that could potentially overwrite the deleted files. However, your comment serves as an essential reminder to users who may be considering downloading recovery software to the same drive.

          Again, thank you for sharing your insights, and we hope our readers take note of your valuable advice to avoid any further data loss.

      2. If I had deleted some data from desktop and later deleted the same data from trash also, in that case, will software be of any help to recover that deleted data??

        1. Yes, software will help you recover data from empty trash as well. However, I suggest you to try the Stellar data recovery free edition to check the recoverable items and later proceed to upgrade the software if satisfied with the results.

      3. Hey Vishal,
        I have deleted desktop wallpaper, themes, doc files, and many basic things some them I don’t even know and now trying to recover with this software, hope it will work!!

      4. Thanks for bursting this popular myth author. While I believe no harm to use Stellar Data Recovery tool, in case you are not well versed with terminal commands.

      Leave a comment

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

      Image Captcha
      Refresh Image Captcha

      Enter Captcha Here :

      Related Posts

      WHY STELLAR® IS GLOBAL LEADER

      Why Choose Stellar?

      • 0M+

        Customers

      • 0+

        Years of Excellence

      • 0+

        R&D Engineers

      • 0+

        Countries

      • 0+

        PARTNERS

      • 0+

        Awards Received