4 ms·
It's not always possible, but whenever I'm going to delete things with rm, I first test the pattern with an ls. I have a coworker who never does this and it dr
by the_af 12y ago
It's not always possible, but whenever I'm going to delete things with rm, I first test the pattern with an ls.
I have a coworker who never does this and it drives me crazy. He just blindly trusts his first attempt. And yes, he has accidentally deleted stuff, but thankfully nothing that was irrecoverable... so far.
- phaer 12y agozsh, or at least oh-my-zsh, asks you for confirmation if your rm command looks dangerous.
- bjackman 12y agoI like to use "trash" (i.e. "put in the Trash") instead of "rm" (i.e. "remove permanently"). For Linux there's a suite called "trash-cli" (on Ubuntu the binary is called "trash-put" so you will probably want to set up an alias). I guess there's something similar for OSX?
- marcosdumay 12y agoThere is also libTrash.so, that when loaded replaces rm entirely. Yet, I've lost interest since I got a nice backup routine.
- tyilo 12y agoyou could just use: mv * ~/.Trash
- KB1JWQ 12y agoThere's rmtrash, which is in Homebrew.
- scarygliders 12y agoI have an alias set for rm as follows, for the root account: # alias rm alias rm='rm -i' It helps to prevent some stupidity, sometimes. Better than nothing.