Easy way to prevent accidental deletion under ubuntu
2018-02-20 11:53
417 查看
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:
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:
相关文章推荐
- How To Compile A Kernel - The Ubuntu Way
- The Easy Way to Setup PostgreSQL 10 Logical Replication
- An easy way to track state of network connection using Perl
- Easy way to implement Asynchronized Product Filtering(Layered Navigation) in Magento
- How to know directory's size in terminal under Ubuntu?
- The easy way to execute sudo command in Python using subprocess.Popen
- Easy way to backup redmine
- An Easy Way to Make a Treemap
- How To Compile A Kernel - The Ubuntu Way
- The Easy Way to Extract Useful Text from Arbitrary HTML
- The easy way to run Powershell 2.0 using .NET Framework 4.0
- Dropout:A Simple Way to Prevent Neural Networks from Overfitting
- An easy way to customize a scrollbar for a control
- an easy way to debug windows service in .net
- how to use BaiduMap in android studio under ubuntu
- An easy way to customize a scrollbar for a control
- [文献阅读]dropout - a simple way to prevent neural networks from overfitting
- How to install an Ubuntu VM under CentOS/Red Hat Xen
- How to setting up ADSL under Ubuntu
- Easy Way to Get All Dependent Library Names 快速获得所有依赖库名称