How to set Clone Ownership and Permission From One File to Another?

February 18 2015

Normally set the ownership and permission for a file using chown and chmod command, If you want to Clone ownership and permissions from another, update using chmod and chown with parameter called --reference,

chown --reference=source thisfile

chmod --reference=source thisfile

Now, the linux.txt file same ownership and permissions set to test.txt.