copy same rights as other file in linux 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