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).
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.
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).