Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to forcibly overwrite cp in linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report