Tuesday, October 27, 2009

Change Group Ownership of Symbolic Links in Unix

By default, chown changes the ownership of the file pointed to by the link, not the link itself. If you need to change the link's owner/group, use the "-h" option.

-h If the file is a symbolic link, change the owner of
the symbolic link. Without this option, the owner of
the file referenced by the symbolic link is changed.

Ex: #chown -h root:root /etc/hosts

#chgrp -h new_group symbolic_link_name

No comments:

Post a Comment