pull down to refresh

I once destroyed a linux install on a server because of a space at the wrong place:
Actual command: sudo mv build/* /var/www/html/ What I entered: sudo mv build /* /var/www/html
We then decided we need deploy scripts and proper user permissions. We used sudo for basically everything we had to do on the server until then.
One way to avoid that is to put alias mv="mv -i" in your bashrc file. The -i will tell you when you're about to overwrite something. But, you have to remember to put that in the bashrc on each server (ideally in the systemwide default bashrc file).
These sorts of command-line mistakes are unavoidable on most OSes, owing to the fact that most OSes were/are written in glorified assembly macro languages (e.g. C, Rust, etc).
reply
Aliases like this can also be dangerous since you get used to your environment. When you are in a different environment, you may run a potentially dangerous command excepting safeguards.
reply