12 ms·
Single most important habit I've developed as a SysAdmin: measure twice, cut once. I never just sudo rm * First, I do echo sudo rm * inspect the out
by FfejL 17y ago
Single most important habit I've developed as a SysAdmin: measure twice, cut once.
I never just
sudo rm *
First, I do
echo sudo rm *
inspect the output, and then use CLI editing to recall the command, and delete the "echo"
I do this for damn near everything that involves a wildcard. It's a lifesaver.
- rick_2047 17y agoI have added a like alias rm='rm -i' to my .bashrc. Sure its a pain when i have to delete whole directories but saves my ass.
- scott_s 17y agoThe rm still makes me nervous. I always just do "ls *", then replace the ls with rm when I'm convinced those are the files I want to delete.
- there 17y agowith tcsh, "set rmstar" will give you a confirmation prompt when doing something like "rm (star)". and while i'm at it, "set noclobber" has saved me a few times from doing something like "grep file > someotherfile" when i meant to do "grep file >> someotherfile".
- lanstein 17y agoI always add the absolute path to the star, so I never accidentally issue rm * down the line when scrolling through the command history.