Linux CP forced overlay

Source: Internet
Author: User

In Linux under the CP command is often used, we often use an operation is: CP-RF source/dest/; But although we use the--force parameter, when the directory has a lot of duplicate name files need to overwrite, but found that the mandatory override parameter does not work, we have to manually enter a lot of yes, when the number of duplicate files, input Yes is the most inefficient thing, let us analyze a problem:

1. First we enter the alias command to see what alias the system has for CP:

Input: Alias | grep CP output: Alias cp= ' Cp-i '

2. Then we use the man CP to find out what role-I parameters

Input: Man CP get:-I,--interactive:prompt before overwrite;

This is clear, the original is the system to the CP has an alias, and then this alias added a each before the manual confirmation of the parameters--interactive, the next to the right remedy, the solution has the following several as a reference:

I. Remove aliases you can use the Unalias CP to temporarily remove the CP alias, or you can use the \cp-rf source/dest/way to cancel the alias

Two. Mandatory overwrite is the need to enter Yes, then we'll give you yes. Yes | CP-RF source/dest/, OK

Linux CP forced overlay

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.