Computer system: Ubuntu 14.04.2
1 Background
When doing a project, you would have wanted to use the RM command to delete a file that started with 14, and the result was as follows:
RM 14 *
Note that there should be no space between 14 and *, but a blank space was mistakenly written, resulting in all files being deleted. In order to retrieve the mistakenly deleted documents, according to some information on the Internet to explore.
2 Ext3grep
sudo apt-get install Ext3grep
The use of this tool in reference [4] has a more detailed description process. However, as noted in reference [5], this tool is only suitable for ext3 file systems, and new versions of Ubuntu systems typically use ext4 file systems, so other tools, such as Extundelete, are required.
3 Extundelete
sudo apt-get install Extundelete
Using this tool, I successfully recovered the files that were mistakenly deleted using the RM command. For the use of this tool, see reference [7]. Here's a quick record of the recovery process.
sudo extundelete/dev/sda1--restore-all
Description:/DEV/SDA1 is the partition where the file is mistakenly deleted. My deleted files were originally in a subdirectory inside the/home/liyihai, and this directory is mounted on the/DEV/SDA1 partition (viewed using the df-h command).
After executing the above command, a named recovered_files directory is generated in the current directory and the recovered file is placed in this directory.
According to reference [7], the recovered file will be renamed, so you need to use the grep command to find the file you want based on the contents of the file.
reference materials
[How to Recover files deleted by RM command under 1]linux
[2]linux RM File Recovery Summary
[3] Linux Use notes: Practical ext3grep Recovery Directory and Documentation Guide (ext3 file system)
[4]ubuntu files deleted by Ext3grep in Ext3 file system
[5] Question: How to recover deleted files under EXT4 partition
[6] Data mistakenly deleted under Linux is no longer a scary thing, ext3grep to help you recover
[Recover deleted files in 7]EXT4 partition]
[8] Restore files mistakenly deleted on Linux EXT4 partitions
[9] "Linux" Linux system ext4 format delete File recovery: Extundelete