1

避免 rm 误操作

 1 year ago
source link: https://fann.im/blog/2015/05/28/avoid-rm/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

避免 rm 误操作

May 28, 2015

规避 rm -rf * 操作:

目录下新建 -i 文件, touch -- -i or touch ./-i

但是对于 rm -rf ./* 无效。

safe-rm 加持保护。

不要 alias rm='rm -i',一旦习惯后在没有 alias 的机子上很容易误伤,可以新建别名,比如 alias del='rm -i',然后习惯用 del 代替 rm.

最后,不要偷懒而滥用 root

Was this page helpful?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK