.\" Copyright (c) 1992 The Regents of the University of California.
.\" %sccs.include.redist.roff%
.\" @(#)symlink.7 5.1 (Berkeley) %G%
.Nd describe symbolic link handling
.Sh SYMBOLIC LINK HANDLING
Due to the fact that a symbolic link and its referenced object coexist
name space, confusion can arise in distinguishing between the link itself
and the referenced object. Traditionally, utilities and system calls
have adopted their own link following conventions in an ad-hoc fashion.
Rules for more a uniform approach are outlined here.
Symbolic links are handled either by operating on the link itself, or by
operating on the object referenced by the link. In the latter case,
an application or system call is said to ``follow'' the link. Symbolic
links may reference other symbolic links, in which case links are
dereferenced until an atomic object is found. Cycles are avoided by
placing an upper limit on the number of links that may be followed.
An error results if this limit is exceeded.
There are three domains for which symbolic link policy is established:
system calls that take file name arguments,
utilities that take file name arguments, and
utilities that traverse file hierarchies.
The system calls that do not follow symbolic links are
All other system calls follow the symbolic link.
The utilities that do not follow symbolic links are
For compatibility with historic systems, the
utility follows symbolic links listed on the command line, unless the
always follows symbolic links.
All other utilities follow symbolic links.
Another issue in symbolic link handling is traversal of a file hierarchy.
File hierarchies can be traversed either ``logically'', by following
symbolic links that point to directories, or ``physically'', by not
The following utilities can perform traversals:
All of these utilities, except for
operate according to the following rules.
By default, these utilities do a physical traversal, never following any
option is specified, the utility will follow symbolic links specified
option is specified, the utilities do a logical traversal, following all
symbolic links whether specified on the command line or encountered while
descending the file hierarchy.
flag is intended to make the command line name space look like the logical
flag is intended to make the entire hierarchy look like the logical name
are exceptions to these rules.
To maintain compatibility with historic systems,
always follows symbolic links on the command line.
options have the effects described above only when the
operates on the name, not the object it points to, and therefore never
utility does not support the
To maintain compatibility with historic systems, the
utility follows all symbolic links in the file hierarchy, including ones
listed on the command line, only when the
utility does not support the