香港vps在linux下rm -rf 是一個(gè)很可怕的命令,因?yàn)橄逻_(dá)這個(gè)命令意味著一旦刪除的文件是無法挽回的,事實(shí)是如此嗎?真的沒有補(bǔ)救措施了嗎?答案是委婉了,在一定的條件下可以補(bǔ)救 ,大家可能熟悉windows下刪除的補(bǔ)救措施是通過相關(guān)的軟件實(shí)現(xiàn)的,在linux下同樣可以做到補(bǔ)救,
但是有個(gè)大前提:就是不能有覆蓋的動(dòng)作(意思就是在嘗試恢復(fù)刪除的數(shù)據(jù)前,刪除文件的目錄內(nèi)不能存放新東西),不然覆蓋多少就損失多少!
這里用到的套件是ext3grep、系統(tǒng)必須默認(rèn)的安裝上e2fsprogs-libs-1.39-23.el5e、2fsprogs-devel-1.39-23.el5、e2fsprogs-1.39-23.el5這些軟件
[root@localhost ~]# rpm -qa|grep e2fsprogs
e2fsprogs-libs-1.39-23.el5
e2fsprogs-devel-1.39-23.el5
e2fsprogs-1.39-23.el5
[root@localhost ~]# ll ext3grep-0.10.2.tar.gz
-rw-r--r-- 1 root root 236364 Oct 17 2011 ext3grep-0.10.2.tar.gz
[root@localhost ~]# tar zxvf ext3grep-0.10.2.tar.gz
[root@localhost ~]# cd ext3grep-0.10.2
[root@localhost ext3grep-0.10.2]# ./configure
[root@localhost ext3grep-0.10.2]# make && make install
[root@localhost ~]# ll /usr/local/bin
total 2656
-rwxr-xr-x 1 root root 2709704 Oct 15 04:46 ext3grep //這句是那個(gè)可執(zhí)行文件