O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commands

chgrp

[OPTION]… GROUP FILE

Change the group membership of the file(s) to GROUP. Group must be a valid option as defined in /etc/groups. Depending on your current access permissions for the target file, this command may or may not work for you. In general, if you already have access to FILE, you can grant access permission to someone else. If you do not currently have permission to access the file, you cannot grant access to yourself.

Example: To change the group ownership of the file testfile to group2, use

chgrp group2 testfile

Example: To recursively change the group ownership of all the files in the directory dir1 to group2, use

chgrp -R group2 dir1

-c, --changes Print out a confirmation for each file whose permission is successfully ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required