How to Recover Deleted Files in a Mac OS X Terminal

Written by ashli norton
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Recover Deleted Files in a Mac OS X Terminal
Recovering deleted files on your Mac is simple with the use of a couple of Terminal commands. (hi tech keyboard closeup image by Mograph from

When using your Mac, you may find it necessary to perform a quick cleanup by deleting old files from your document folders, for example, or from the desktop. Following such a cleanup, if you realise that you deleted a few files that you didn't want to delete and need to recover them, there is a way. File recovery is simple using the Mac OS X terminal.

Skill level:


  1. 1

    Power on your Mac.

  2. 2

    Click on your "Applications" folder to navigate to the Mac OS X Terminal.

  3. 3

    Click on the "Utilities" folder.

  4. 4

    Double-click on "Terminal" to open the application.

  5. 5

    Type in the following Terminal command: "cd .Trash" (without quotation marks).

  6. 6

    Hit the "Return" key on your Mac.

  7. 7

    Key in the name of the file you would like to recover using the following format "mv xxx ../" (without quotations). Replace the "xxx" part of the format with the full name of the file you deleted and now want to recover.

  8. 8

    Hit the "Return" key on your Mac.

  9. 9

    Type "Quit" (without quotations) in the Terminal window.

  10. 10

    Press the "Command" and "F" keys simultaneously to launch the "Finder" window.

  11. 11

    Enter the name of the deleted file in the search bar at the top right part of the window.

  12. 12

    Click on the file you found in Finder and drag it onto your desktop or the location you wish to save the file.

  13. 13

    Click on the red "X" in the Finder window to close the window.

Tips and warnings

  • Always back up your Mac to ensure your files remain safely on your computer.
  • Enter the Terminal commands exactly. Entering them incorrectly will not yield a successful file recovery.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.