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)
<1966085> (4052). <1966086> (4028).
<1973249> <1969680> (
<1966095> <1966303> (232)
<1973221> <1973226> (180)
<1966325> (136) <1973234> (108) Auto_del_avira
<1966086> <1973227> (
<1973225> <1966313> (
<1966097> Renetwork.log <1966315> (3700)
<3019134> <1969676> (
<1993419> <1969675> (
<1969677> pwd.txt <1969678> (3580) tmp.txt
<1993423> (3564) <1998856> (3540) linux-gdb-rh9
<1966602> <1966606> (3488)
<1966607> (3464). CLINUX.SH.SWX <1966607> (3440).
<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.

Related Article

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: 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.