Super User is a question and answer site for computer enthusiasts and power users. 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

currently there's a xxx dir already in /home/yyy
I'm trying to overwrite it cp -fr ../xxx /home/yyy/
doesn't work still prompts me to overwrite the individual files. how do I fix it?

share|improve this question

migrated from May 5 '10 at 11:16

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

Indeed, see if it's aliased. You can do this by typing alias cp. If it's in that list you can remove it by typing unalias. (The default) -i option will be gone too.

Overwriting won't be a problem anymore...

share|improve this answer

or, to circumvent the problem with aliases in the first place, call the cp binary directly. Mostly, this will work:

/bin/cp -fr .../xxx /home/yyy/
share|improve this answer
Or escape the command \cp -fr ... – mpez0 May 5 '10 at 13:43

I'll assume you are using BASH or SH as your shell, in which case you can explicitly undo all aliases by prefixing your command line with command. E.g.

command cp -fr ../xxx /home/yyy/

Which would ignore any aliases for cp and any shell-function called cp.

share|improve this answer

Looking here

-i is ‘interactive’ aka ALWAYS PROMPT, and evidently overrides -f

Make sure your cp is not aliased or something. (run type cp ). As a simple example, the order of the options is important. For instance rm -if f will say nothing. rm -fi f will prompt me before removing f.

share|improve this answer
if it's aliased, AFAIK his input should override the alias, because it will be something like cp -i -fr etc. – o0'. May 5 '10 at 11:23
@Lo'oris: On my system (RHEL 5), the -i overrides the -f. – GreenMatt May 5 '10 at 13:45

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.