cp Befehlskraft

3373
user15586

Momentan gibt es bereits ein xxx Verzeichnis in / home / yyy.
Ich versuche es zu überschreiben
. wie kann ich das beheben?

2

4 Antworten auf die Frage

4
tersmitten

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...

3
Boldewyn

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/ 
Oder entgehen Sie dem Befehl `\ cp -fr ...` mpez0 vor 14 Jahren 2
1
RobM

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.

0
nc3b

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.

Wenn es ein Alias ​​ist, sollte AFAIK seine Eingabe den Alias ​​überschreiben, da es so etwas wie "cp -i -fr" usw. sein wird. o0'. vor 14 Jahren 0
@ Lo'oris: Auf meinem System (RHEL 5) überschreibt -i das -f. GreenMatt vor 14 Jahren 0