When I execute rm I mean to delete. When I'm not sure I expyre[1] the path: https://github.com/lonetwin/expyre
[1] shameless plug -- but you did ask ;-)
21–30 of 76 posts
When I execute rm I mean to delete. When I'm not sure I expyre[1] the path: https://github.com/lonetwin/expyre
[1] shameless plug -- but you did ask ;-)
rm is for removing stuff. If you don’t want to remove the file, use mv. Take care when entering commands, if it’s important that you don’t mess up, spend an extra second. Don’t run around shooting rm -rf as super user. With great powers comes great responsibility.
Would be nice if filesystems were garbage collected, though. I don't see a fundamental reason why rm couldn't be undoable the second after you issue it.
I wish something like this were built into kernel filesystem driver. All deletions automatically go to this specific place in the filesystem.
This would be fun as an experiment to see how quickly it fills up the drive, but probably utterly useless in production. A lot of stuff is creating and deleting files all the time, e.g. logrotate.
Earlier quoted context omitted.
Even simpler: alias del="mv -t ~/.Trash/"
Now let's delete them after roughtly 30 days: alias del="mv -t ~/.Trash/ ; find ~/.Trash/ -mtime +30 -exec rm {} \;"
Backups too. Nothing replaces backups.
rm is for removing stuff. If you don’t want to remove the file, use mv. Take care when entering commands, if it’s important that you don’t mess up, spend an extra second. Don’t run around shooting rm -rf as super user. With great powers comes great responsibility.
Would be nice if filesystems were garbage collected, though. I don't see a fundamental reason why rm couldn't be undoable the second after you issue it.
This is another example that shows that Bash (and similar shells) should not be used for scripting. It's great for the command line, but for scripting there are much better, cleaner, faster and safer alternatives.