2

Title explains it;

Somehow in installing the 'z' directory jumper, I made our linux machines CP command act strangely (for example: it no longer prompts for overwrites, it auto-forces it whether we want it or not) - does anybody know how to revert my linux box's CP command back to its default setting?

2 Answers 2

2

Linux cp does not, by default, prompt you when overwriting. If it used to, then as @mirkobrankovic said, it was most likely defined as an alias.

User specific aliases are usually in ~/.bashrc and global aliases are in /etc/bash.bashrc. You probably had an alias in one of those files that turned cp into cp -i if you were asked before overwriting.

To set up that alias again, add this line to either of the two files I mentioned above:

alias cp='cp -i'

The alias will take effect next time you open a terminal window.

2

On modern linux systems, cp no longer prompts to overwrite file.
If it used to do that before, than you probably lost an alias.
Add

alias cp='cp -i'

at the end of or /etc/bash.bashrc. Logout and log back in console to take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.