How to Restore deleted files on the Mac OS using the power of Mac Terminal

A brief about Mac OS and Terminal

We all have knowledge on Macintosh computers. Don’t we?

Macintosh or simply Mac OS is one of the most well-known Graphical User Interface based operating system developed by Apple for Macintosh computers. The concept of Mac OS is different from system softwares like MS DOS as it expertizes more in simplicity to make it easier to be used through mouse gestures and graphic controls performed by the user.

TechAtLast TTX  App Apple Calendar

Did you know?

The Mac OS is credited to be one the earliest graphical user interface concept on which a system software has been developed and is a part of the Macintosh clone program. Since then Apple has integrated major revisions to its design, the latest being Mac OS X.

It is quite difficult to utilize the Mac OS to its full potential without the knowledge of Mac Terminal.

So what is a Terminal?

A terminal is a text based interface where commands are given by the user to execute a certain task. Improper usage of command lines in a Mac Terminal can prove to be bane than bliss as it may mess up with your system. But to execute difficult tasks like restoring files deleted mistakenly, the Terminal can be your best friend.

Did you lose important files too? You surely made the worst mistake of your life!

Losing important files often make us regret of our actions. Most of us are too reliant on the computer to keep hard copies of important documents and hence mishandling of such files can cause great damage to our work putting us into trouble. The loss of important data might also occur from formatting or partitioning, both indulging in deleting user files without our knowledge. If we are working on a Mac OS, our mistakes can be corrected if we have enough knowledge about commands and terminal. Hence, as we progress, we shall delve into the process of restoring files using Terminal on a Mac OS.

How to Guide to Recover Deleted Files from the Mac Terminal

How to open the Terminal?

[bctt tweet=”Unless you know how to ignite an oven, you can never cook food.”]

The simplest way to open a Mac Terminal is by opening Applications followed by clicking on Utilities and selecting Terminal from the drop down menu. Once you are able to access the Terminal, your task of recovering the deleted files comes into effect.

TechAtLast TTX MacdTrace01

When a file is deleted, it is sent to the trash to be cleared by the memory later on.

Trash? What does it mean? Trash refers to the location where the deleted files are kept and is equivalent to the Windows Recycle Bin. Open the trash from the Terminal using the command:


That’s a simple command isn’t it? But won’t you decipher their meaning?

‘ls’ displays the list of files in the Trash while ‘a’ ensures the visibility of all files present. The ‘.’ symbol in the command line implies that the Trash of the Mac OS is a hidden folder.

Half your work is done. Now simply recover the files – How? Keep on reading!

After you have the list of files, chose the ones you want to restore and type in the command line:

mv.Trash/file or simply mv file ~/file.

While the former command is in use when your Terminal is executing your default home directory, the latter comes to effect when your terminal is in the Trash directory. Understand the difference.

When you first open the Mac Terminal as stated above, the Terminal’s default location is the home directory. Now in order to move files from another directory, you either have to shift to that respective directory using a command like cd.Trash, where cd stands for change directory, or you have to include the name of that directory in order to move a file to your default home directory. If you have already changed your directory prior to or during listing of your deleted files, then simply use the move command to move your deleted file from the Trash.

It is quite obvious that ‘mv’ stands for moving a file or folder. It is one of the frequently used commands used in Mac Terminal like ‘cp’ which stands for copy. The ‘file’ syntax in the command line has to be replaced with the name of your desired file you want to restore. But it is has to be noticed that the name of the file is not present in the Trash list, it means that the file or files have been permanently deleted and there is no way of recovering without using third party apps which may or may not be able in successfully executing the desired task.

TechAtLast TTX Port MacOSX Terminal

Restoring File Using Terminal – Overview

We are now well aware of the procedures involved in recovering a deleted file by using the Terminal. It can also be concluded that not only for the purpose of recovering lost files, the Mac Terminal can also be used for various root purposes which enables the user to get the most out of the Mac OS.

Able to recover your deleted file using the guide? Cheers on your success!



3 responses to “How to Restore deleted files on the Mac OS using the power of Mac Terminal”

  1. Ganesh Sankar K K Avatar
    Ganesh Sankar K K

    Great info Daniel bro! This article quickly helped me recover all my deleted files 🙂 Switching on to Mac OS for the very first time, I was unaware about all these features. All I knew is the recovery options and software’s available in Windows. Thanks, your article helped me to do the same on Mac too 🙂
    Be in touch!

  2. Ankit Sharma Avatar
    Ankit Sharma

    Hi Olawale

    I appreciate your research and knowledge. Thanks for this informative post. Keep posting such useful stuff.

  3. Carry Avatar

    Thanks for article!
    Maybe you can go to CNET to search and download uFlysoft data recovery software to recover your files.

Leave a Reply

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