linux command copy directory with its permissions code example
Example: linux copy directory permissions to another directory
chown --reference=otherfile thisfile
chmod --reference=otherfile thisfile
chown --reference=otherfile thisfile
chmod --reference=otherfile thisfile