During cp overwrite, no matter what parameter-f is added or whether the file is overwritten or not, if the file in the test Directory is copied directly to the cp overwrite directory of test1, no matter what parameter-f is added or whether the file is overwritten, copy the files under the test directory to the cp & ndash directory test1 without packaging; when rtest/* test1 executes the preceding command, if test1 has cp overwrite, no matter what parameter-f is added or whether it is overwritten, if the files under the test directory are copied to the cp directory of test1 without packaging, no matter what parameter-f is added or whether it is overwritten, copy directly without packaging
Copy the files under the test directory to the test1 directory.
Cp-r test/* test1
When executing the preceding command, each file in test1 will prompt whether to overwrite it;
Cp-rf test/* test1
When the above command is executed, every file in test1 will no longer be prompted;
This is our desired ideal state, but sometimes-f is added, there will be a prompt.
Because the server will add the alias cp = 'CP-I 'by default, when you execute cp, the actual execution is cp-I.
As you can see under alias.
# Alias
Alias cp = 'CP-I'
Use the following solutions
# Vi ~ /. Bashrc
Add "#" before alias cp = 'CP-I 'to comment out this line: wq! Save the launch and log on again.
The next time you use cp-rf, you can directly overwrite existing files. of course, if you don't want to change the alias, you can escape it by \ cp-rf.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service