星期四, 6月 11, 2009

Managing file ownership in Linux

What does the chgrp command do?

Changes the group to which a file belongs
Changes the owner of a file
Enables a file owner to change file permissions
Sets security attributes



Which option instructs the chown command to disregard any error messages related to the command's operation?

-c
-C
-f
-R




Suppose that you want the transport file to belong to a new group called expenses. The group's ID is 221. Which command enables you to change the group for the file?

chgrp 221
chgrp 221 /home/ksmith/expenses
chgrp 221 /home/ksmith/transport
chmod 221


Suppose that you want to transfer ownership of a file called sales, which was created by Kevin Smith, to Maria Gomez, and you want the file to belong to a group called reviews. You also want to list the file information. Which command do you use to do this?

chown -c mgomez:reviews /home/ksmith/sales
chown -f mgomez:reviews /home/ksmith/sales
chown -R mgomez:reviews /home/ksmith/sales
chown -v mgomez:reviews /home/ksmith/sales