Linux modifies RM instruction execution (data security)

Source: Internet
Author: User

Quote Article A:HTTP://HI.BAIDU.COM/JLUSUOYA/ITEM/32AE398958088755840FABFB

Reference: Replace RM with MV.

Quote Article b:http://blog.csdn.net/qiudakun/article/details/6659072

Introduction: How to recover a file after RM has deleted it. Personal knowledge is not yet common.

In the last two weeks, the code was deleted two times because of a mis-operation. But because of the time is relatively tight, it is directly re-written, and not using the recovery function.

1: The detailed method can be referenced in article A.

2: Edit Path CD ~/.BASHRC

3: Add code at the end of the file:

#replace RM with MV, use TRM to run true RM
Trash ()
{
MV [email protected] ~/.local/share/trash/files #注意, which can be defined in its own right. When you delete a file for a long time, remember to clear the folder.

}

Alias trm= "/bin/rm"

Alias rm= "Trash"

4: Reload. Bashrc:source. BASHRC

Linux modifies RM instruction execution (data security)

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.