I somehow made our linux box's "CP" command act differently than the default, how can I revert it back to default?

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?

Samuel Stiles

Posted 2013-07-02T12:20:13.797

Reputation: 133

Answers

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.

terdon

Posted 2013-07-02T12:20:13.797

Reputation: 45 216

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.

mirkobrankovic

Posted 2013-07-02T12:20:13.797

Reputation: 936