How to Recover Deleted Files on Linux
As a Linux user, you may have accidentally deleted an important file or folder. Don’t worry; with a few simple steps, you can easily recover your deleted files on Linux. In this guide, we will go through the steps required to recover deleted files on Linux.
Step 1: Stop using the device
When you realize you have deleted files, stop using the device where the file was stored. This is important, as it prevents your device from overwriting the deleted files, which makes the recovery process more difficult.
Step 2: Identify the file system
Knowing the file system on your Linux machine is important when it comes to recovering deleted files. The most commonly used file system on Linux is the ext4. You can determine your file system type by entering the command `lsblk`.
Step 3: Install File Recovery Tools
To recover deleted files on Linux, you need to have a recovery tool installed on your system. Some of the most commonly used tools used in recovery process are PhotoRec, TestDisk, and Foremost.
Step 4: Recover the Deleted Files
PhotoRec and TestDisk are two of the most commonly used file recovery tools on Linux machines. After downloading and installing the application, run them to recover the deleted files.
PhotoRec is a free and open-source file recovery tool that can be used on any type of file system. After launching the application, select the hard drive where the files were stored and choose the file types you want to recover. Then, scan the hard drive and select the files you want to recover.
TestDisk, on the other hand, is a powerful tool that can recover deleted partitions on your hard drive as well as recover lost files. After launching the application, select the disk where you deleted files and choose the type of partition you want to recover. The tool will then start scanning and recover the deleted files.
Step 5: Save the Recovered Files
After successfully recovering your deleted files, store the files in a separate disk or partition. This is important, as it prevents overwriting the files accidentally.