2 ms·
"Not to mention how dangerous it is to use. Accidentally type the > symbol? Enjoy overwriting whichever file came after in the command." At least in zsh, you c
by pmoriarty 5y ago
"Not to mention how dangerous it is to use. Accidentally type the > symbol? Enjoy overwriting whichever file came after in the command."
At least in zsh, you can prevent such mistakes by
setopt NO_CLOBBER
It's saved my bacon many times.
Also, from bitter experience I've forced myself to get in to the habit of never typing:
rm *
but instead always doing:
cd ..
rm foo/*
It forces me to be more conscious of what I'm deleting.
- teddyh 5y ago> in zsh […] setopt NO_CLOBBER In Bash it’s set -o noclobber or set -C
- bccdee 5y agoI have `alias rm="echo DISABLED"` in my shell rc, and I have `trash` defined as a big shell function that safely moves stuff to the x desktop trash bin without clobbering anything. It's mildly irritating, but it gives me incredible peace of mind.