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