This article introduces how to directly overwrite and not prompt cp in Linux.

Source: Internet
Author: User
Tags what parameter

When a new server is deployed, No matter what parameter-f is added or whether the request is overwritten, this is intolerable when a large number of cp overwriting operations are performed.
Copy the files under directory a to directory B
The following is a code snippet:
Cp-r a/* B
When executing the preceding command, each file in B will prompt whether to overwrite it;
The following is a code snippet:
Cp-r-f a/* B
When executing the preceding command, every file in B will no longer be prompted;
This is our desired ideal state, but sometimes-f is added. Why do we still have a prompt? Some servers Add the alias cp = cp-I by default. When you execute cp, the actual execution is cp-I.
Execute alias on the terminal.
The following is a code snippet:
[Root @ devdb ~] # Alias
Alias cp = cp-I
Yes
The following is a code snippet:
[Root @ devdb ~] # Vi ~ /. Bashrc
Add "#" before alias cp = cp-I to comment out this line: wq! Save the launch and log on again.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.