ubuntu recover deleted files

First of all, the place where the deleted file is located has not been overwritten again, then the file can be recovered, otherwise it will be useless.

use tools

extundelete
sudo apt-get install extundelete 

1. You can check the help first

extundelete --help

2. Restore files by time
That is, before restoring to the time when the file was deleted, this time is a parameter, which can be obtained like this

date -d "2018-05-08 15:00:00" +%s  

The result is 1525762800, which is the number of seconds elapsed from 1970-01-01 00:00:00 to the time enclosed in double quotes.
However, you still need a parameter, in which partition the file to be recovered is located, use the following command to view the partition information

df -h

Partition information
Generally speaking, if you need to restore which partition, it is best to make some backups in advance, or unmount the partition first, otherwise the recovery will fail.

sudo extundelete /dev/vda1 --after 1525762800 --restore-all 

3, no 3 anymore

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326602488&siteId=291194637