The chgrp command is also used to modify the group of a file or directory. This can only modify the group owner, unlike the previous command, chown,which could be used to modify user ownership and group ownership. The syntax of this command is as follows:
$ chgrp <new_groupname> <filename_dirname>
The chgrp command can be used to change the group of the myfile file to the group jack,as shown in the following screenshot: