I’m trying to use the cp command and force an overwrite.
I have tried cp -rf /foo/* /bar, but I am still prompted to confirm each overwrite.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do
yes | cp -rf xxx yyy, but my gutfeeling says that if you do it as root – your.bashrcor.profilehas an alias ofcptocp -i, most modern systems (primarily RH-derivatives) do that to root profiles.You can check existing aliases by running
aliasat the command prompt, orwhich cpto check aliases only forcp.If you do have an alias defined, running
unalias cpwill abolish that for the current session, otherwise you can just remove it from your shell profile.You can temporarily bypass an alias and use the non-aliased version of a command by prefixing it with
\, e.g.\cp whatever