How to clone ownership and permissions from another file

  • 7014997
  • 02-May-2014
  • 02-May-2014

Environment

Linux distribution OS

Situation

How to copy, transfer, move, clone ownership and permissions from one file to another.

Resolution

The following commands will clone or transfer ownership and permissions:
chown --reference=otherfile thisfile
chmod --reference=otherfile thisfile