Changing the group association of files and directories with chgrp

Suppose you have a file called black that is currently being used by the pot group and you want to change the file's permissions so that it can be accessed by the kettle group. To do this, you'll need to change which group the file is associated with—in this case, change the association from the pot group to the kettle group. You can change which group a file or directory is associated with using chgrp, as shown in Code Listing 5.5.

To change group association with chgrp:

1.
ls -l
To begin, type ls -l at the shell prompt to verify the file's name and the group it's associated with, as in Code Listing 5.5. Remember that the second column in the middle of the listing, immediately ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.