Hacker News new | ask | show | jobs
by DarkWiiPlayer 1641 days ago
I'd be afraid of relying too much on this only to, at some point, be on a server or user that doesn't have this and accidentally deleting something too early.

Maybe it'd be best to just give this command a new name like `delete` or `trash` just to be safe.

1 comments

> Maybe it'd be best to just give this command a new name like `delete` or `trash` just to be safe.

But this would defeat the original purpose, i.e. the prevention of someone accidentally using rm.

Not necessarily. If you get used to using `delete` all the time, that is most likely what you would use on the server too. Once you trip over it missing, you are reminded that you are in dangerous territory.
There are many assumptions here. I manage several servers, but many of these are co-managed. Second, it is not foolproof - muscle memory is very strong and for sure sooner or later I'll type rm again. Third, it doesn't prevents the use of rm in scripts.

That said, an accidental removal of files has never been a problem for me (an accidental chmod -R caused me more woes once), and these days with snapshots it's a complete non issue.

If you get used to using a different command, you won't use `rm` accidentally
Sure, but in the context of the present thread I'd have to wait until the history file gets rotated - which will never happen on the systems I manage.
just grep through your history file and delete lines containing `rm` easy fix