Home   |   Guides and Tutorials   |   What's New?   |   Comments   |   About
 

chgrp: Changing the Group of a File or Directory

by Tammy Fox
Last Modified: Wednesday, 19-May-2004 11:55:30 EDT

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.

What's Related


All Rights Reserved Linux Headquarters © 2000-2007
Linux is a registered trademark of Linus Torvalds
All logos are registered trademarks of their respective owners
Last modified: Wednesday, May 19, 2004