How to recover deleted files on Mac using Terminal?

Ugh, accidents happen, right? Deleting important files on a Mac can be such a headache! But don’t worry; there’s a way to recover them using Terminal. Here’s a step-by-step guide:

  1. Open Terminal: Navigate to Applications > Utilities > Terminal.

  2. List Directory Contents: First, navigate to the directory where the files were stored. Use the cd command.

    cd path/to/your/folder
    
  3. Locate Deleted Files: Mac doesn’t have a simple undelete command in Terminal, so you’ll need to check the .Trashes directory at the root of your drive. Use this command to navigate there:

    cd /.Trashes/501/
    

    Note: The folder number 501 may differ. Use ls -la /Volumes/<DriveName>/.Trashes/ to find your Trashes folder.

  4. Copy Deleted Files Back: Once you find the files, copy them back to your preferred directory.

    sudo cp name_of_your_file /path/to/desired/location
    
  5. Permissions: If permissions are an issue, you may need to involve sudo for superuser access.

But, let’s be real. Getting cozy with Terminal can be a bit overwhelming, especially if you’re not used to it. Instead, a user-friendly solution like Disk Drill Data Recovery Software might save you a lot of time and hassle. Disk Drill specializes in recovering deleted files efficiently without diving into complex Terminal commands.

Hope you nail down the recovery! The struggle’s real, but you got this! Keep us updated on how it goes.

11 Likes