Learning Linux(8): Preventing 'rm' command from removing important files

来源:互联网 发布:wingide linux 破解 编辑:程序博客网 时间:2024/05/16 06:54

In Ubuntu, use command:

 

$ sudo apt-get install trash-cli
$ alias rm=trash


then put that alias in .bashrc or the appropriate login script for your shell of choice.

The trash-cli package is a command-line interface to the same trash can that GNOME and KDE and other use. So anything you delete via the trash command can be restored by GNOME/KDE and vice-versa.

The other commands in the trash-cli package are list-trash, empty-trash, and restore-trash.


原创粉丝点击