How to Recover Deleted Files from Mac Terminal [2 Ways] - Qiling  

How to Recover Deleted Files from Mac Terminal in 2 Ways


Accidental data loss occurs quite often during the daily use of our computer. It's not rare that you accidentally deletedthe files you need on your Mac. When that happens, you will inevitably wonder how to retrieve your lost files.

Follow this guide, you'll learn how torecover deleted filesonMac in two most efficient ways:

recover deleted files mac

PAGE CONTENT:
How Did You Delete Files, Pick aWay to Recover Deleted Files
Way 1.How to Recover Deleted Files on Mac UsingTerminal
Way 2.How to Retrieve Deleted FilesUsing MacData Recovery Software

How Did You Delete Files on Mac

Here we listed some normal ways of deleting files on Mac and collected two ways to help you retrieve files on Mac from different file lost situations.

Figure out the file loss reasons and select the right way to recover deleted files from your Mac now:

#1. Use Terminal #2. Use Qiling Mac File Recovery Software
  • Drag files to Trash
  • Right-click to move files to Trash
  • Drag files to Trash
  • Right-click to move files to Trash
  • Empty Trash
  • Use Option + Shift + Command + Delete keys
  • Use RM command in Terminal
  • Use RM - R commandin Terminal
  • Use RM - f commandin Terminal

Note that Terminal can't help you restoredeleted files that are permanently deleted due to emptying Mac trash or using Terminalrmcommands.

What is rm, -r, -f in Terminal?
rm:It means to permanently delete a file.
-R:It means todelete a folder and its content.
-f:It means force removal without confirmation.

Now, it's your turn to pick the right way and follow the specific tutorial to undo file deletion orundo RM deletion command from the Mac Terminal right now.

Way 1.How to Recover Deleted Files on Mac UsingTerminal

Applies to:Restore deleted files on Mac by dragging or right-clicking moved to Trash.

It's aregular way thatMac users sometimesuse Terminal to delete or undelete files. It can not only deletefiles on your Mac like in the situation presented above but also recover deleted files usingcommand line.

Follow the steps below to recover deleted files on Mac using Terminal now:

(It's an example thatperformed on a MacBook Pro running macOS Mojave 10.14.2.)

Step 1.Go to "Finder" > "Applications" > "Utilities" and double-click "Terminal".

How to Recover Deleted Files on Mac using Terminal

Step 2.Type cd.Trash and hit "Return".

Step 3.Type lsand hit "Retrun".

Step 4.Type mv yourfilename ../ and hit "Return". (It must be your full file name in the command line.)

Step 5.Type Quit andexit the Terminal window.

Step 6. Go to "Finder",enter the name of your lostfilein the search bar at the top-right corner.

Tip
cd.Trashmeans to locate Trash.
lsmeans to display the name of files and subdirectories in the directory.
mv yourfilename ../means to move thefile to its originaldirectory.

In the result, you can see the deleted file you just recovered. Move it to any location as you like.

Way 2.How to Retrieve Deleted FilesUsing MacData Recovery Software

Applies to:Retrieve files from Trash, Option+Shift+Command+Delete, rm,rm -R,rm -f command.

As Terminal command listed in Way 1 onlyworks to recover deleted files from Trash. You mayfailto recover your deleted filesonMac due to emptying trash, using Option+Shift+Command+Delete keys, or runningrm,rm -R,rm -f command.

The other way you can try is to let reliableMacdata recovery softwarehelp. Deep Data Recovery can help you if you follow the above three steps to retrieve files deleted from Mac Terminal.

Steps to Retrieve Files Deleted from Mac (Undo RM -R -F):

Step 1. Launch Deep Data Recovery for Mac. Select file types and click "Next" to start.

Select file types that you want to recover

Step 2. Select the location where your important data & files were deleted and click the "Scan" button.

select the location where data was deleted and click scan

Step 3. The software will run both quick scan and deep scan and work hard to find as many deleted files as possible on the selected volume.

click recover now button to recover deleted files

Step 4. The scan results will be displayed in the left pane. Just select the file(s) and click the "Recover" button to get them back.

After restoring files from Mac, remember to save the files to an external hard drive. Aftermaking sure the device is available to save files again, you can move back the recovered files on your Mac.

What Else Can Qiling Mac Deep Data Recovery Do:

1. Recover files from Mac that Terminal command line can't do:

2. Retrieve multiple types of files, including:

Qiling Mac Deep Data Recovery supportsrestoring files likephotos, documents, videos, audio, emails, and other filesfrom Mac.

3. Restore data from all types of storage devices:

Qiling Mac data recovery software can recover data on Mac(PC),hard drive, USB drive, SD card, Memory card, digital camera, etc., devices.

Take Time, Follow to Bring Your FilesBack onMac Now

On this page, we showed you the normal ways that you might commit to deleting files on Mac. According to most Mac users' feedback, we also collected two reliable and practical ways that can help you safely bring the lost files back on your Mac.

Now, it's your turn. Take your time, and follow this guide to bring your files back on Mac now.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!