I have two folders, and I would like to do:
cp -R folder1/ folder2/
So that I all the sub folders missing in folder2 will be created, and there files copied. And all the folders in folder2 that are missing from folder1 stay the same.
cp -R folder1/. folder2/
You can use
folder1/* instead, if you don't mind that
* will not match "hidden" files which begin with a
If there are files in folder2 with the same name as files in folder1, they will be overwritten without prompting or warning.
cp, instead use
cp copy all files and it spreads time and I/O, But
mv only change inode:
mv -f dir1/ dir2