linux dupliucate file permission 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