Introduction
chgrp is a standard Unix/Linux command that allows you to change the group of a file/directory. To view the current group of a file, execute the following command:
ls -l.
This will display the files in the current directory in long format. The fourth column in the table is the group that the file/directory is associated with. For further information on reading permissions, see the Reading Files/Directories Permissions guide.
Using chgrp
To change the group of a file/directory, you must either be the owner and a member of the group you want to change the file/directory for or you must be root. Execute the following command:
chgrp group hello (where group is the new group and hello is the name of the file or directory you want to change the owner for)
Thus, chgrp linuxhq chgrp.html would change the group of the file chgrp.html to linuxhq.






