This commit is contained in:
Michael Kerrisk 2008-06-26 12:56:53 +00:00
parent 419f5a4cc2
commit 9085070854
1 changed files with 40 additions and 40 deletions

View File

@ -221,7 +221,7 @@ It is important to realize that this rule includes commands which may
optionally traverse file trees, e.g.\& the command optionally traverse file trees, e.g.\& the command
.I "chown file" .I "chown file"
is included in this rule, while the command is included in this rule, while the command
.IR "chown -R file" , .IR "chown \-R file" ,
which performs a tree traversal, is not. which performs a tree traversal, is not.
(The latter is described in the third area, below.) (The latter is described in the third area, below.)
@ -231,14 +231,14 @@ link instead of following the symbolic link, e.g., it is desired that
change the ownership of the file that change the ownership of the file that
.I slink .I slink
is, whether it is a symbolic link or not, the is, whether it is a symbolic link or not, the
.I -h .I \-h
option should be used. option should be used.
In the above example, In the above example,
.I "chown root slink" .I "chown root slink"
would change the ownership of the file referred to by would change the ownership of the file referred to by
.IR slink , .IR slink ,
while while
.I "chown -h root slink" .I "chown \-h root slink"
would change the ownership of would change the ownership of
.I slink .I slink
itself. itself.
@ -261,27 +261,27 @@ command is also an exception to this rule.
For compatibility with historic systems (when For compatibility with historic systems (when
.BR ls (1) .BR ls (1)
is not doing a tree walk, i.e., the is not doing a tree walk, i.e., the
.I -R .I \-R
option is not specified), option is not specified),
the the
.BR ls (1) .BR ls (1)
command follows symbolic links named as arguments if the command follows symbolic links named as arguments if the
.I -H .I \-H
or or
.I -L .I \-L
option is specified, option is specified,
or if the or if the
.IR -F , .IR \-F ,
.IR -d , .IR \-d ,
or or
.I -l .I \-l
options are not specified. options are not specified.
(The (The
.BR ls (1) .BR ls (1)
command is the only command where the command is the only command where the
.I -H .I \-H
and and
.I -L .I \-L
options affect its behavior even though it is not doing a walk of options affect its behavior even though it is not doing a walk of
a file tree.) a file tree.)
.IP * .IP *
@ -294,7 +294,7 @@ command does not follow symbolic links named as argument by default.
The The
.BR file (1) .BR file (1)
command does follow symbolic links named as argument if the command does follow symbolic links named as argument if the
.I -L .I \-L
option is specified. option is specified.
.\" .\"
.\"The 4.4BSD system differs from historical 4BSD systems in that the .\"The 4.4BSD system differs from historical 4BSD systems in that the
@ -326,7 +326,7 @@ Operations that apply to symbolic links are performed on the links
themselves, but otherwise the links are ignored. themselves, but otherwise the links are ignored.
The command The command
.I "rm -r slink directory" .I "rm \-r slink directory"
will remove will remove
.IR slink , .IR slink ,
as well as any symbolic links encountered in the tree traversal of as well as any symbolic links encountered in the tree traversal of
@ -348,27 +348,27 @@ possible by commands that perform file tree walks:
A command can be made to follow A command can be made to follow
any symbolic links named on the command line, any symbolic links named on the command line,
regardless of the type of file they reference, by specifying the regardless of the type of file they reference, by specifying the
.I -H .I \-H
(for "half\-logical") flag. (for "half-logical") flag.
This flag is intended to make the command-line name space look This flag is intended to make the command-line name space look
like the logical name space. like the logical name space.
(Note, for commands that do not always do file tree traversals, the (Note, for commands that do not always do file tree traversals, the
.I -H .I \-H
flag will be ignored if the flag will be ignored if the
.I -R .I \-R
flag is not also specified.) flag is not also specified.)
For example, the command For example, the command
.I "chown -HR user slink" .I "chown \-HR user slink"
will traverse the file hierarchy rooted in the file pointed to by will traverse the file hierarchy rooted in the file pointed to by
.IR slink . .IR slink .
Note, the Note, the
.I -H .I \-H
is not the same as the previously discussed is not the same as the previously discussed
.I -h .I \-h
flag. flag.
The The
.I -H .I \-H
flag causes symbolic links specified on the command line to be flag causes symbolic links specified on the command line to be
dereferenced for the purposes of both the action to be performed dereferenced for the purposes of both the action to be performed
and the tree walk, and it is as if the user had specified the and the tree walk, and it is as if the user had specified the
@ -378,18 +378,18 @@ A command can be made to
follow any symbolic links named on the command line, follow any symbolic links named on the command line,
as well as any symbolic links encountered during the traversal, as well as any symbolic links encountered during the traversal,
regardless of the type of file they reference, by specifying the regardless of the type of file they reference, by specifying the
.I -L .I \-L
(for "logical") flag. (for "logical") flag.
This flag is intended to make the entire name space look like This flag is intended to make the entire name space look like
the logical name space. the logical name space.
(Note, for commands that do not always do file tree traversals, the (Note, for commands that do not always do file tree traversals, the
.I -L .I \-L
flag will be ignored if the flag will be ignored if the
.I -R .I \-R
flag is not also specified.) flag is not also specified.)
For example, the command For example, the command
.I "chown -LR user slink" .I "chown \-LR user slink"
will change the owner of the file referred to by will change the owner of the file referred to by
.IR slink . .IR slink .
If If
@ -405,24 +405,24 @@ traverses, they will be treated in the same fashion as
.IP * .IP *
A command can be made to A command can be made to
provide the default behavior by specifying the provide the default behavior by specifying the
.I -P .I \-P
(for "physical") flag. (for "physical") flag.
This flag is intended to make the entire name space look like the This flag is intended to make the entire name space look like the
physical name space. physical name space.
.PP .PP
For commands that do not by default do file tree traversals, the For commands that do not by default do file tree traversals, the
.IR -H , .IR \-H ,
.IR -L , .IR \-L ,
and and
.I -P .I \-P
flags are ignored if the flags are ignored if the
.I -R .I \-R
flag is not also specified. flag is not also specified.
In addition, you may specify the In addition, you may specify the
.IR -H , .IR \-H ,
.IR -L , .IR \-L ,
and and
.I -P .I \-P
options more than once; options more than once;
the last one specified determines the command's behavior. the last one specified determines the command's behavior.
This is intended to permit you to alias commands to behave one way This is intended to permit you to alias commands to behave one way
@ -441,10 +441,10 @@ and therefore never follows a symbolic link.
The The
.BR rm (1) .BR rm (1)
command does not support the command does not support the
.IR -H , .IR \-H ,
.IR -L , .IR \-L ,
or or
.I -P .I \-P
options. options.
.IP * .IP *
To maintain compatibility with historic systems, To maintain compatibility with historic systems,
@ -452,15 +452,15 @@ the
.BR ls (1) .BR ls (1)
command acts a little differently. command acts a little differently.
If you do not specify the If you do not specify the
.IR -F , .IR \-F ,
.IR -d .IR \-d
or or
.I -l .I \-l
options, options,
.BR ls (1) .BR ls (1)
will follow symbolic links specified on the command line. will follow symbolic links specified on the command line.
If the If the
.I -L .I \-L
flag is specified, flag is specified,
.BR ls (1) .BR ls (1)
follows all symbolic links, follows all symbolic links,