POSIX and Unix-like Operating Systems
In POSIX-compliant operating systems, symbolic links are created with the symlink
system call. The ln
shell command normally uses the link
system call, which creates a hard link. When the ln -s
flag is specified, the symlink system call is used instead, creating a symbolic link. Symlinks were introduced in 4.2BSD Unix from U.C. Berkeley.
The following command creates a symbolic link at the command-line interface (shell):
ln -s target_path link_pathtarget_path is the relative or absolute path to which the symbolic link should point. Usually the target will exist, although symbolic links may be created to non-existent targets. link_path is the path of the symbolic link.
After creating the symbolic link, it may generally be treated as an alias for the target. Any file system management commands (e.g., cp
, rm
) may be used on the symbolic link. Commands which read or write file contents will access the contents of the target file. The rm
(delete file) command, however, removes the link itself, not the target file.
The POSIX directory listing application, ls
, denotes symbolic links with an arrow after the name, pointing to the name of the target file (see following example), when the long directory list is requested (-l
option). When a directory listing of a symbolic link that points to a directory is requested, only the link itself will be displayed. In order to obtain a listing of the linked directory, the path must include a trailing directory separator character ('/', slash).
Read more about this topic: Softlink
Famous quotes containing the words operating and/or systems:
“Go on then in doing with your pen what in other times was done with the sword; shew that reformation is more practicable by operating on the mind than on the body of man.”
—Thomas Jefferson (17431826)
“The only people who treasure systems are those whom the whole truth evades, who want to catch it by the tail. A system is just like truths tail, but the truth is like a lizard. It will leave the tail in your hand and escape; it knows that it will soon grow another tail.”
—Ivan Sergeevich Turgenev (18181883)