How to forcibly overwrite cp in linux
It is believed that many inexperienced people are at a loss about how to force cp coverage in linux. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Cp mandatory override in linux
Always have it reconfirmed when using cp copy in linux, and its.
[root@master test] # cp test-r-f
Cp: overwrite 'test/a1.txt'? Y
Cp: overwrite 'test/a2.txt'? Y
Cp: overwrite 'test/aa.txt'? Y
Cp: overwrite 'test/eeds-cms.sql'? Y
Cp: overwrite 'test/gpbl-parb.sql'? Y
Cp: overwrite 'test/gp-gpmall.sql'? ^ C
Reason:
[root@master] # grep-E'cp-i'.
.bashrc: alias cp='cp-i'
.cshrc: alias cp'cp-i'
.tcshrc: alias cp'cp-i'
The .bashrc personalization profile is set to reconfirm every time.
Cancel the method of reconfirmation:
1.
Add a "#" comment before alias cp='cp-i', save exit, source ~ / .bashrc, take effect.
two。
Add "\" when copying, such as
\ cp aa.txt aa.txt
Check whether the time is updated after the change, ll--full-time
3. Temporarily canceled, the parameter of cp-I is invalid when the terminal is reopened.
Unalias cp
Cp cp aa.txt aa.txt
After reading the above, have you mastered how to force cp to overwrite in linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!