Consolidation of directories under Linux and overwriting of files

Source: Internet
Author: User

There are two directories and files in the test and new,test directories, the new directory has changed some of the directories and files under test, as well as some new files, now merge the two directories and overwrite the old files under test.

Cp-frap new/* test/

The command is actually very simple, explained below:

-F Force overwrite, do not ask yes/no (-I default, that is, the default is interactive mode, ask whether to overwrite)
-R recursive replication, including directories
-A To do a backup, here can not use this parameter, we can first back up the entire test directory
-P Keep the properties of the new file unchanged

One thing to remember is that implementing merging and overwriting is using the CP, not the MV. when we paste a folder under Win7, we can also implement merge and overwrite functions, and the system will prompt whether to overwrite or save two files with the same name.

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.