First of all, the use of RM commands under Linux must be used when your mind is clear.
Here to do the experiment, rm-rf/root/1.txt.
Download the Extundelete installation package https://sourceforge.net/projects/extundelete/
Install dependent packages Yum install-y e2fsprogs*; Yum Install-y e2fslibs*
Unzip the Extundelete installation package, tar JXVF extundelete-0.2.4.tar.bz2
CD extundelete/
./configure
Make && make install
To view the disk mount where the file directory is located:
$ df-tfilesystem Type 1k-blocks used Available use% mounted on/dev/xvda1 ext4 41282880 5185180 34000652 1 4%/tmpfs tmpfs 509300 0 509300 0%/dev/shm
Recover files
extundelete/dev/xvda1--restore-directory '/root/'
See if recovery
$ ls/root/recovered_files/root/1.txt
File Recovery complete
This article is from the "Echo Xiayun" blog, so be sure to keep this source http://linuxerxy.blog.51cto.com/10707334/1755093
Recover RM files with Extundelete