Linux chgrp command

Linux chgrp command

 Linux chgrp command


Linux chgrp command is used for changing the group of the file or directory.

Syntax:

chown <GROUP> [FILE]...

Example:

Set the file group of testfile.txt to group “staff”. Now all the member users of the staff group have privileges on file as a group user.

chgrp staff testfile.txt

Change File Ownership Recursively

You can specify the option -R to change group recursively to all files in the specified directory an subdirectory. For example, Set the group staff to all files under /home/rahul directory.

chgrp -R staff /home/rahul
Reactions

Post a Comment

0 Comments

close