Comments on: How to Use Chown Command to Change File Ownership [11 Examples] https://www.tecmint.com/chown-command-examples/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 15:14:42 +0000 hourly 1 By: Narendra Kangralkar https://www.tecmint.com/chown-command-examples/comment-page-1/#comment-1926725 Fri, 09 Dec 2022 06:56:30 +0000 https://www.tecmint.com/?p=28980#comment-1926725 @dragonmouth,

No, they are not the same. In example #4 we are using user and group names whereas in example #11 we are using the ids associated with them. We can use either name or id with the chown command. For example, the below command uses the combination of the user id and group name:

$ sudo chown 1001:narendra file-1.txt

]]>
By: dragonmouth https://www.tecmint.com/chown-command-examples/comment-page-1/#comment-1926555 Thu, 08 Dec 2022 21:51:10 +0000 https://www.tecmint.com/?p=28980#comment-1926555 Isn’t Example #4 and Example #11 the same? In Example #4 you are changing the alpha userid and groupid while in example #11 you are changing the numeric IDs.

]]>
By: Narendra Kangralkar https://www.tecmint.com/chown-command-examples/comment-page-1/#comment-1923864 Sat, 03 Dec 2022 13:26:51 +0000 https://www.tecmint.com/?p=28980#comment-1923864 @dragonmouth,

Here, the main intention is to show the updated ownership. There are multiple ways to achieve this. For example, using the ls command or -v flag. We can use either of them.

In addition to this, we can also use the stat command as shown below:

$ stat -c "Owner = %U, Group = %G" file-1.txt
Owner = narendra, Group = narendra

]]>
By: dragonmouth https://www.tecmint.com/chown-command-examples/comment-page-1/#comment-1923459 Fri, 02 Dec 2022 14:55:13 +0000 https://www.tecmint.com/?p=28980#comment-1923459 In Example #11, why don’t you use the "-v" flag instead of the “ls” command?

]]>