Using the Copy command CP under Linux, do not let the "overwrite" (file overwrite) prompt method appear.
In general we use the CP command with the-f option, and I hope we don't let the "overwrite" prompt (the hint of file overwrite) appear. Such as:
# CP-RF SourceFile TARGETDIR
Or
#cp-R-F sourcefile targetdir
-R means recursive replication, that is, copying the folder and all of its files.
-F means that you are not prompted when you encounter a file of the same name, overwriting directly.
But why add-F, but also the "overwrite" hint?
This is because the system prevents us from accidentally overwriting a file that should not be overwritten, and uses the alias of the command. Use the alias command to see:
# Alias
Alias cp= ' Cp-i '
Alias l.= ' ls-d. *--color=tty '
Alias ll= ' Ls-l--color=tty '
Alias ls= ' ls--color=tty '
Alias mv= ' Mv-i '
Alias rm= ' Rm-i '
From the top we can see that the CP command we entered is actually the "cp-i" command. Several other commands, such as Ll,ls mv,rm, also use aliases.
The first of these solutions:
Adding a "\" symbol to the CP does not run with an alias, as follows:
# \cp-f SourceFile TARGETDIR
The second solution:
Edit the file and comment out the alias.
# VI ~/.BASHRC
In alias cp= ' Cp-i ' before adding "#" comment off this line, wq! save the launch, and then re-login on it.
Transferred from: http://blog.csdn.net/iw1210/article/details/46550707
Using the Copy command CP under Linux, do not let the "overwrite" (file overwrite) prompt method appear. Go