POSIX 1003.2b/D9 symbolic links
[unix-history] / usr / src / usr.sbin / chown / chown.8
index b70cf38..7cf292a 100644 (file)
@@ -1,9 +1,9 @@
-.\" Copyright (c) 1990, 1991, 1993
+.\" Copyright (c) 1990, 1991, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" %sccs.include.redist.man%
 .\"
-.\"     @(#)chown.8    8.1 (Berkeley) %G%
+.\"     @(#)chown.8    8.2 (Berkeley) %G%
 .\"
 .Dd 
 .Dt CHOWN 8
 .\"
 .Dd 
 .Dt CHOWN 8
 .Nd change file owner and group
 .Sh SYNOPSIS
 .Nm chown
 .Nd change file owner and group
 .Sh SYNOPSIS
 .Nm chown
-.Op Fl HRfh
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
+.Op Fl f
 .Ar owner Op Ar :group
 .Ar file ...
 .Nm chown
 .Ar owner Op Ar :group
 .Ar file ...
 .Nm chown
-.Op Fl HRfh
+.Oo
+.Fl R
+.Op Fl H | Fl L | Fl P
+.Oc
+.Op Fl f
 .Ar :group
 .Ar file ...
 .Sh DESCRIPTION
 .Ar :group
 .Ar file ...
 .Sh DESCRIPTION
@@ -27,25 +35,43 @@ sets the user ID and/or the group ID of the specified files.
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl H
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl H
-When encountering a symbolic link on the command line, follow it.  All other
-symbolic links encountered in the traversal are not followed.
+If the
+.Fl R
+option is specified, symbolic links on the command line are followed.
+(Symbolic links encountered in the tree traversal are not followed.)
+.It Fl L
+If the
+.Fl R
+option is specified, all symbolic links are followed.
+.It Fl P
+If the
+.Fl R
+option is specified, no symbolic links are followed.
 .It Fl R
 Change the user ID and/or the group ID for the file hierarchies rooted
 in the files instead of just the files themselves.
 .It Fl f
 Don't report any failure to change file owner or group, nor modify
 the exit status to reflect such failures.
 .It Fl R
 Change the user ID and/or the group ID for the file hierarchies rooted
 in the files instead of just the files themselves.
 .It Fl f
 Don't report any failure to change file owner or group, nor modify
 the exit status to reflect such failures.
-.It Fl h
-When encountering a symbolic link anywhere in the traversal, follow it.
 .El
 .Pp
 .El
 .Pp
-The ownership of a symbolic link is immutable, so unless the
-.Fl h
+Symbolic links don't have owners, so unless the
+.Fl H
 or 
 or 
-.Fl H 
-flag is set,
+.Fl L 
+option is set,
 .Nm chown
 on a symbolic link is a no-op.
 .Nm chown
 on a symbolic link is a no-op.
+The
+.Fl H ,
+.Fl L
+and
+.Fl P
+options are ignored unless the
+.Fl R
+option is specified.
+In addition, these options override each other and the
+command's actions are determined by the last one specified.
 .Pp
 The
 .Ar owner
 .Pp
 The
 .Ar owner
@@ -79,6 +105,12 @@ Previous versions of the
 utility used the dot (``.'') character to distinguish the group name.
 This has been changed to be a colon (``:'') character so that user and
 group names may contain the dot character.
 utility used the dot (``.'') character to distinguish the group name.
 This has been changed to be a colon (``:'') character so that user and
 group names may contain the dot character.
+.Pp
+Previous versions of the
+.Nm chown
+utility changed the owner of symbolic links specified on the command
+line.
+In this system, symbolic links do not have owners.
 .Sh SEE ALSO
 .Xr chgrp 1 ,
 .Xr find 1 ,
 .Sh SEE ALSO
 .Xr chgrp 1 ,
 .Xr find 1 ,