How to prevent RM-RF from accidentally deleting files in Linux

Source: Internet
Author: User
Tags rdesktop

Process: Using ln to do directory link testing, the implementation of the RM-RF completely delete the contents of the directory link, the execution is over, only to find the tragedy.

Then I thought I could recover no, but it was late. Need to rewrite your partition read-only, but when I install the system on a whole block ...

Querying directory node via Debugfs

The code is as follows Copy Code
1966083 (12).   1966081 (4084). <1966084> (4072) rdesktop.sh
<1966085> (4052). Rdesktop.sh.swp <1966086> (4028). rdesktop.sh.swx
<1973249> dropbox.py <1969680> (mysqlcrack.pl)
<1966095> denyip.sh <1966303> (232) sshcrack.pl
<1973221> mysqlcrack.sh <1973226> (180) tcspeed.sh
<1966325> (136) renetwork.sh <1973234> (108) Auto_del_avira
<1966086> slowloris.pl <1973227> (tcclear.sh)
<1973225> tcshow.sh <1966313> (sshcrack.sh)
<1966097> Renetwork.log <1966315> (3700) sshck.sh
<3019134> makedir.sh <1969676> (genpwd.sh)
<1993419> makedirnew.sh.swp <1969675> (genpwd.sh~)
<1969677> pwd.txt <1969678> (3580) tmp.txt
<1993423> (3564) makedirnew.sh <1998856> (3540) linux-gdb-rh9
<1966602> clinux.sh.swp <1966606> (3488) filesuffix.sh
<1966607> (3464). CLINUX.SH.SWX <1966607> (3440). clinux.sh.swx
<1966609> (3408). [Command LINE].SWPX


I will try this recovery, on the wood to consider so much, to recover out is empty, tragedy.

Again, extundelete,testdisk the same tragedy.

Summary: After the file deletion, immediately stop writing data operation; Linux partitions do not get on a disk,

Think of the best backup of their important documents, (*^__^*) Hee ..., these files I backed up ...

The internet said RM-RF to other instructions, lest manslaughter.

I think the wood is necessary, when the RM can be deleted without the F parameters are prompted, and always remember to back up Oh,

Now let's add the RM command RF usage

-F, even if the original file attribute is set to read-only, is deleted directly, without confirmation.
-R Deletes the directory and the file below.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.