linux copy directory and contents to another location code example
Example 1: copy contents of directory to another directory linux
cp -a /source/. /dest/
Example 2: linux copy directory permissions to another directory
chown --reference=otherfile thisfile
chmod --reference=otherfile thisfile