Comments on: How to Copy File Permissions and Ownership to Another File in Linux https://www.tecmint.com/copy-file-permissions-and-ownership-to-another-file-in-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 09:11:25 +0000 hourly 1 By: Aaron Kili https://www.tecmint.com/copy-file-permissions-and-ownership-to-another-file-in-linux/comment-page-1/#comment-972615 Sat, 24 Feb 2018 08:31:46 +0000 https://www.tecmint.com/?p=28638#comment-972615 In reply to Alexey.

@Alexey

Your most welcome, once more. Thanks for following us.

]]>
By: Alexey https://www.tecmint.com/copy-file-permissions-and-ownership-to-another-file-in-linux/comment-page-1/#comment-972299 Fri, 23 Feb 2018 05:57:04 +0000 https://www.tecmint.com/?p=28638#comment-972299 In reply to Aaron Kili.

Thank you again!

]]>
By: Aaron Kili https://www.tecmint.com/copy-file-permissions-and-ownership-to-another-file-in-linux/comment-page-1/#comment-972114 Thu, 22 Feb 2018 08:05:58 +0000 https://www.tecmint.com/?p=28638#comment-972114 In reply to Alexey.

@Alexey

You are welcome.

And you can copy the permissions and ownership of CATALOG1 to CATALOG2. Then use the -p flag of the cp command to preserve permissions and ownership while copying files from CATALOG1 to CATALOG2 like this:

$ chown --reference=CATALOG1 CATALOG2
$ chmod --reference=CATALOG1 CATALOG2
$ cp -p ./CATALOG1/* ./CATALOG2/

I hope this makes sense to you.

]]>
By: Alexey https://www.tecmint.com/copy-file-permissions-and-ownership-to-another-file-in-linux/comment-page-1/#comment-971897 Wed, 21 Feb 2018 10:54:04 +0000 https://www.tecmint.com/?p=28638#comment-971897 Thank you for your article.

May I use the “–reference=” key for folders, not only files?

For example, to copy permissions or owner on catalog CATALOG1 with all files located in this folder to CATALOG2?

]]>