Check out example codes for "linux copy directory permissions to another directory". It will help you in understanding the concepts better.

Code Example 1

chown --reference=otherfile thisfile
chmod --reference=otherfile thisfile

Learn ReactJs, React Native from akashmittal.com