chgrp

Change the group ownership for a file or directory.

Usage

  • chgrp [OPTION]... GROUP FILE

    chgrp [OPTION]... --reference=RFILE FILE

Changes the group ownership of FILE to GROUP. With -reference changes the group ownership of FILE to be the same as RFILE.

There are many options, see the manpage for chgrp(1).

Examples

  • chgrp www-data file1

Gives group ownership of file1 to the www-data group.

  • chgrp -R users dir1

Recurses through the directory and all subdirectories changing group ownership for all files and directories to the users group. Be careful with the -R switch, it can be a big pain to undo mistakes with it!


CategoryCommandLineInterface