简体   繁体   中英

Why does anyone think “alias rm='rm -i'” is a good idea?

I have used a number of systems where there is a default alias for rm to rm -i . I have to assume that this is to try to have users check what they are deleting, but in practice I have only seen this train users to habitually use rm -rf , which is incredibly counterproductive. Not only does it increase required effort and train users to use a more dangerous command, but it also means that a number of features of rm (warning the user on read-only and missing files) are effectively removed. I understand specific use-cases where rm -i would be appropriate, but it seems like a terrible idea for a global alias.

So I repeat my question: Why would anyone think this is a good idea?

rm -rf is such a legendarily dangerous command that any shell user should already know to avoid it, regardless of what aliases they have set up. Meanwhile, alias rm = rm -i has always seemed to me an obvious and necessary safeguard, given that rm is irreversible, unlike sending a file to the trash.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM