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.