Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to copy all newer jpgs from one folder to another using the following command

cp -u --force /home/oldfolder/*.jpg /home/newfolder/

and I get the following promt:

cp: overwrite `/home/newfolder/4095-181.jpg'?

The '-u' I know is working fine as is it only prompting me on the newer files, but i dont want to get the prompt i just want it to overwrite them. I have tried --force and -f

Any suggestions?

Thanks in advance

share|improve this question
up vote 24 down vote accepted

Maybe your cp command is an alias? Try:

\cp -uf file folder/
share|improve this answer
Thanks that worked great – icelizard Jul 16 '09 at 11:52
yes | cp <whatever else>
share|improve this answer
Cheers, that worked, so i didn't have to enter yes everytime but I still got the promt – icelizard Jul 16 '09 at 11:53

Type "type cp" to see where it points, or if it is aliased.

share|improve this answer
Had the same problem. Entering type cp revealed that cp was an alias for cp -i, and obviously -i (interactive) takes precedence over -f (force). – Peter Boughton Dec 15 '10 at 19:51

Use full path to cp , it will override the alias

/usr/bin/cp -u --force /home/oldfolder/*.jpg /home/newfolder/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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