CentOS cp-fr src dest, even if the addition of-F is not forced to cover, then what is the matter? One or two files OK, just lose a few yes, but what if n more files do not lose the dead? There are three solutions available below.
Let's enter the alias command to see what alias the system has for CP.
[[email protected] ~]# alias
Alias cp= ' Cp-i '
Alias l.= ' ls-d. *–color=auto '
Alias Ll= ' Ls-l–color=auto '
Alias ls= ' Ls–color=auto '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
Alias Which= ' Alias | /usr/bin/which–tty-only–read-alias–show-dot–show-tilde '
then [[email protected] ~]# man CP
Look what I mean.
-i,–interactive Prompt before overwrite
Originally before the overwrite will prompt, then our solution also came out, with Unalias CP to remove the CP alias, restore pure CP.
[[Email protected] ~] #unaslias CP (This is just a temporary cancellation of the CP alias, not permanent)
[[Email protected] ~] #cp-fr src dest This will be done, will not be prompted to overwrite.
Enter the \CP command, which also cancels the CP alias.
[email protected] ~]#\cp-fr src dest
Enter YES|CP-FR src dest and use the pipe to enter yes automatically.
[[Email protected] ~] #yes | CP cp-fr SRC dest let the pipeline automatically input a lot of yes, you can complete the forced copy
Linux CP forced overwrite