Linux - Cp ask for overwriting, Override the overwriting while copying

Cp ask for overwriting


In linux operating system when you try to copy files from one directory to another directory, the cp(copy) command will ask for overwriting if the file already exists.

Even if you use force option it will ask for overwriting. you can get out of this problem by two ways.

1) Use unalias
  # unalias cp

2) Remove the alias from ~/.bashrc
 # cat ~./.bashrc

     # .bashrc

     # User specific aliases and functions

     alias rm='rm -i'
     alias cp='cp -i'
     alias mv='mv -i'

Delete or remove cp alias from the file ~/.bashrc
 # vi .bashrc

     # .bashrc

     # User specific aliases and functions

     alias rm='rm -i'
     alias mv='mv -i'
save the file and exit :wq!

once you do this you will be able to copy the files without any problem. Now the cp command will not ask for overwriting when copying the files.

The topic on Linux - Cp ask for overwriting is posted by - Maha

Hope you have enjoyed, Linux - Cp ask for overwritingThanks for your time

Tech Bluff