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)