- Linux Systems
- Cp Command Problems Forcing Overwrite Using cp Command In Linux
This Page Contains information about Cp Command Problems Forcing Overwrite Using cp Command In Linux By wallpaperama in category Linux Systems with 18 Replies. Last Upated: Thu Mar 17, 2016 
Fri Jan 25, 2008
today i was trying to copy a many files and when i send this command:
cp -rf /this/file /to/this/file
i get this prompts:
cp: overwrite '/this/file /to/this/file' ?
when i look at the man pages for cp it says:
if an existing destination file cannot be opened, remove it and
so it shouldn't ask me, so i found out that de defaults on the dedicated linux server we got from www.webune.com has cp as alias. so if you having this same problem, then run this command to see your alias:
alias cp='cp -i'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
as you can see, i do have an alias with cp
so how do you overwrite without prompt?
what i need to do is remove that cp alias witht he unalias command so i send this coommand:
so now when you do the alias
command, you wont see the cp alias anymore
so what happens if your not the admin or dont have access to root, then you can run an unaliased cp command, try
$ /bin/cp -rf /this/file /to/this/file
hope this helps..
thanks for the guys at www.webune.com for their support on this question