Easy to use, easy to forget
Copy directory and subdirectories
The -R flag is to signal a recursive copy
Note that this will place source-dir/* in dst-dir. If you want to place source-dir/* in dst-dir/source-dir/* you must use the following command:
If you want to move all directories to sub-directory, in case you used the wrong command above, use the following:
Copy directory and subdirectories
The -R flag is to signal a recursive copy
cp -R source-dir dst-dir
Note that this will place source-dir/* in dst-dir. If you want to place source-dir/* in dst-dir/source-dir/* you must use the following command:
mkdir /dst-dir/source-dir
cp -R source-dir dst-dir/source-dir
cp -R source-dir dst-dir/source-dir
If you want to move all directories to sub-directory, in case you used the wrong command above, use the following:
mv !(subdir) subdir