At least in zsh, you can prevent such mistakes by
setopt NO_CLOBBER
Also, from bitter experience I've forced myself to get in to the habit of never typing:
rm *
cd .. rm foo/*
In Bash it’s
set -o noclobber
set -C
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V...
At least in zsh, you can prevent such mistakes by
It's saved my bacon many times.Also, from bitter experience I've forced myself to get in to the habit of never typing:
but instead always doing: It forces me to be more conscious of what I'm deleting.