Linux Copy Folder command __linux

Source: Internet
Author: User
Replace the B folder and all the files in the a directory with the B1 folder in the A1 directory and all of its files
is a copy folder
# Assuming the fullpath of the B folder in the A directory is/aa/bb/cc/a/b # Assume that the fullpath of the
B1 folder under A1 directory is/dd/ee/ff/a1/b1
# 
# You can use the following instructions to put all the/aa/b/cc/ All files and folders/files under A/b
# No matter how many layers, copy to/DD/EE/FF/A1/B1 below:

cd/aa/bb/cc/a/b find
.-name-print | cpio-pdmvu/d D/EE/FF/A1/B1

originally in/aa/b/cc/a/b under the all will not change.
all files and folders will be copy
to the new below (/DD/EE/FF/A1/B1), and the file and folder date and user permissions will be identical to the original. This is the advantage of using "Cpio". You can try it.
The correct solution
Cp-r A/b a1/
rm-fr a1/b1
mv a1/b a1/b1
Linux One of the important thoughts on four single commands to complete a single goal, complex purposes can be combined with multiple single purposes.

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.