Saturday, November 2, 2013

Change Group Linux Command Options

Change Group Linux Command Options

Linux Command: chgrp

Usage: change group ownership

Chgrp Syntax: # chgrp [options] newgroup filename/directoryname


Example For chgrp Command:

1. To change a file sample.txt from root group to a new group
    named 'group2'

    # chgrp group2 sample.txt


2. To change the files and its subdirectories of a directory named

'test' from root group to new
    group 'newgroup'

    # chgrp -R newgroup test


3. To change the group for the specific file test.txt


    # chgrp -c newgroup test.txt


4. To use the group value of another file instead of specifying explicitly


    # chgrp --reference=/home/dhana/sample.txt sample.txt

Change Group Linux Command Options

No comments:

Post a Comment

Linux Tips and tricks,Online Linux Helpers