Easy way to prevent accidental deletion under ubuntu

前端之家收集整理的这篇文章主要介绍了Easy way to prevent accidental deletion under ubuntu前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

As it happens many many times,people under cmd mode,use 'rm -rf' so unfetteredly including me... And I finally realized it's better to make some adjustment.

Most of the time,I see ppl alias rm='rm -i',which can be a good idea,while I would prefer alias rm='gvfs-trash' under ubuntu. Also other more sophisticated ways exist. If opt to rm='gvfs-trash',the '-rf' would be useless and unrecognizable to the shell.

To only put alias rm='gvfs-trash' in the cmd line cannot be enough as after reboot it would be gone. Better way is to add it into the .bashrc file.



Also it's better to add one additional alias,and that is alias sudo='sudo ',so it would work when "sudo rm filename".

/home/user/.bashrc:

原文链接:https://www.f2er.com/ubuntu/349942.html

猜你在找的Ubuntu相关文章