What is the point of chgrp?
12,915
Solution 1
When you use chgrp
you are using a simple tool to change one thing... group permissions. For many people this is preferred over using chown
, especially when you run the risk of mistyping a character while using the chown
command and completely breaking permissions to whatever files/folder you specified.
So instead of doing one of the following:
chown user:group [file/dir]
chown :group [file/dir]
You just do:
chgrp group [file/dir]
This keeps the risks of changing file permissions in a production grade environment down. Which is always good for SysAdmins.
Solution 2
Remember:
- A file is owned by exactly one group and one user. That file may have varying permissions depending on the user and/or group attempting to use it.
chown
changes ownership of files to specified user/groupchmod
changes permissions of files to specified user/groupchgrp
changes ownership of files to specified group
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I know what
chgrp
andchown
do.
My question is sincechown
does the same thing aschgrp
(and even more), what is the point ofchgrp
?