Section 3.29. Changing a File s Group: chgrp


[Page 73 (continued)]

3.29. Changing a File's Group: chgrp

The first step toward protecting my lyrics was to change the group name of "heart.final" from "cs" to "music." I did this by using the chgrp utility, described in Figure 3-39.

Figure 3-39. Description of the chgrp command.

Utility: chgrp -R groupname { fileName }*

The chgrp utility allows a user to change the group of files that he/she owns. A super-user can change the group of any file. All of the files that follow the groupname argument are affected. The -R option recursively changes the group of the files in a directory.



[Page 74]

I used chgrp like this:

$ ls -l heart.final -rw-r--r-- 1 glass  cs    213 Jan 31 00:12 heart.final $ chgrp music heart.final       ...change the group. $ ls -l heart.final             ...confirm it changed. -rw-r--r-- 1  glass music 213 Jan 31 00:12 heart.final $ _ 


You may also use chgrp to change the group of a directory.




Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net