Linux Command - chgrp

chgrp change group ownership for files and directories

Syntax

1
chgrp [OPTION] GROUP FILE
option description
-R, –recursive change files and directories recursively
-v, –verbose verbose mode
–reference=RFILE use RFILE’s owner and group rather than specifying OWNER:GROUP values

Example

change a file’s group to be ‘adm’

1
chgrp adm file1

change a directory and its files’ group to be ‘root’

1
chgrp -R root dir

Reference