In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, a symbolic link (also symlink or soft link) is a file whose purpose is to point to a file or directory (called the "target") by specifying a
path
A path is a route for physical travel – see Trail.
Path or PATH may also refer to:
Physical paths of different types
* Bicycle path
* Bridle path, used by people on horseback
* Course (navigation), the intended path of a vehicle
* Desir ...
thereto.
Symbolic links are supported by
POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
and by most
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s, such as
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
,
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, and
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
. Support also exists in
Windows 10
Windows 10 is a major release of Microsoft's Windows NT operating system. The successor to Windows 8.1, it was Software release cycle#Release to manufacturing (RTM), released to manufacturing on July 15, 2015, and later to retail on July 2 ...
and
11.
CTSS on
IBM 7090
The IBM 7090 is a second-generation Transistor computer, transistorized version of the earlier IBM 709 vacuum tube mainframe computer that was designed for "large-scale scientific and technological applications". The 7090 is the fourth member o ...
had files linked by name in 1963.
By 1978 minicomputer operating systems from
DEC, and in Data General's
RDOS included symbolic links.
Overview
A symbolic link contains a text string that is automatically interpreted and followed by the operating system as a path to another file or directory. This other file or directory is called the "target". The symbolic link is a second file that exists independently of its target. If a symbolic link is deleted, its target remains unaffected. If a symbolic link points to a target, and sometime later that target is moved, renamed or deleted, the symbolic link is not automatically updated or deleted, but continues to exist and still points to the old target, now a non-existing location or file. Symbolic links pointing to moved or non-existing targets are sometimes called ''broken'', ''orphaned'', ''dead'', or ''dangling''.
Symbolic links are different from
hard link
In computing, a hard link is a directory entry (in a Directory (computing), directory-based file system) that associates a name with a Computer file, file. Thus, each file must have at least one hard link. Creating additional hard links for a fil ...
s. Hard links do not link paths on different
volumes
Volume is a measure of regions in three-dimensional space. It is often quantified numerically using SI derived units (such as the cubic metre and litre) or by various imperial or US customary units (such as the gallon, quart, cubic inch). The ...
or
file systems, whereas symbolic links may point to any file or directory irrespective of the volumes on which the link and target reside.
Hard links always refer to an existing file, whereas symbolic links may contain an arbitrary path that does not point to anything.
Symbolic links operate transparently for many operations: programs that read or write to files named by a symbolic link will behave as if operating directly on the target file. However, they have the effect of changing an otherwise hierarchic filesystem from a
tree
In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, e.g., including only woody plants with secondary growth, only ...
into a directed graph, which can have consequences for such simple operations as determining the current directory of a process. Even the Unix standard for navigating to a directory's parent directory no longer works reliably in the face of symlinks. Some
shells heuristic
A heuristic or heuristic technique (''problem solving'', '' mental shortcut'', ''rule of thumb'') is any approach to problem solving that employs a pragmatic method that is not fully optimized, perfected, or rationalized, but is nevertheless ...
ally try to uphold the illusion of a tree-shaped hierarchy, but when they do, this causes them to produce different results from other programs that manipulate pathnames without such heuristic, relying on the operating system instead.
Programs that need to handle symbolic links specially (e.g., shells and backup utilities) thus need to identify and manipulate them directly.
Some Unix as well as Linux distributions use symbolic links extensively in an effort to reorder the file system hierarchy. This is accomplished with several mechanisms, such as variant, context-dependent symbolic links. This offers the opportunity to create a more intuitive or application-specific
directory tree
In computing, a directory is a file system cataloging structure that contains references to other computer files, and possibly other directories. On many computers, directories are known as folders or drawers, analogous to a workbench or the tra ...
and to reorganize the system without having to redesign the core set of system functions and utilities.
POSIX and Unix-like operating systems
In
POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
-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
In computing, a hard link is a directory entry (in a Directory (computing), directory-based file system) that associates a name with a Computer file, file. Thus, each file must have at least one hard link. Creating additional hard links for a fil ...
. When the
ln ''-s''
flag is specified, the symlink() system call is used instead, creating a symbolic link. Symlinks were introduced in 1982 in
4.1a BSD Unix from
U.C. Berkeley.
The following command creates a symbolic link at the
command-line interface
A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
(shell):
ln -s target_path link_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. is the path of the symbolic link.
After creating the symbolic link, some operations can be used to treat it as an alias for the target. However, the
lstat
,
lchown
and
readlink
operations are unique to symbolic links and do not apply to the target; by using those system calls, programs that examine the file system (e.g.,
ls
,
find
) can report on symbolic links (instead of their targets, if any). Because the
rename
and
unlink
system calls are coded to operate directly on symbolic links, file system management commands (e.g.,
rm
,
mv
) affect the symbolic link itself (instead of being applied to the symbolic link target, if any). The
rm
(delete file) command removes the link itself, not the target file. Likewise, the
mv
command moves or renames the link, not the target. The
cp
command has options that allow either the symbolic link or the target to be copied. Commands which read or write file contents will access the contents of 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).
Note: In the example below do not create "three" directory before creation of link in /tmp directory.
$ mkdir -p /tmp/one/two
$ echo "test_a" >/tmp/one/two/a
$ echo "test_b" >/tmp/one/two/b
$ cd /tmp/one/two
$ ls -l
-rw-r--r-- 1 user group 7 Jan 01 10:01 a
-rw-r--r-- 1 user group 7 Jan 01 10:01 b
$ cd /tmp
$ ln -s /tmp/one/two three
$ ls -l three
lrwxrwxrwx 1 user group 12 Jul 22 10:02 /tmp/three -> /tmp/one/two
$ ls -l three/
-rw-r--r-- 1 user group 7 Jan 01 10:01 a
-rw-r--r-- 1 user group 7 Jan 01 10:01 b
$ cd three
$ ls -l
-rw-r--r-- 1 user group 7 Jan 01 10:01 a
-rw-r--r-- 1 user group 7 Jan 01 10:01 b
$ cat a
test_a
$ cat /tmp/one/two/a
test_a
$ echo "test_c" >/tmp/one/two/a
$ cat /tmp/one/two/a
test_c
$ cat a
test_c
Storage of symbolic links
Early implementations of symbolic links stored the symbolic link information as data in regular files. The file contained the textual reference to the link's target, and the file mode bits indicated that the type of the file is a symbolic link.
This method was slow and an inefficient use of
disk-space on small systems. An improvement, called fast symlinks, allowed storage of the target path within the
data structure
In computer science, a data structure is a data organization and storage format that is usually chosen for Efficiency, efficient Data access, access to data. More precisely, a data structure is a collection of data values, the relationships amo ...
s used for storing file information on disk (
inode
An inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribu ...
s). This space normally stores a list of disk
block
Block or blocked may refer to:
Arts, entertainment and media Broadcasting
* Block programming, the result of a programming strategy in broadcasting
* W242BX, a radio station licensed to Greenville, South Carolina, United States known as ''96.3 ...
addresses allocated to a file. Thus, symlinks with short target paths are accessed quickly. Systems with fast symlinks often fall back to using the original method if the target path exceeds the available inode space. The original style is
retroactively termed a slow symlink. It is also used for disk compatibility with other or older versions of operating systems.
Although storing the link value inside the inode saves a disk block and a disk read, the operating system still needs to parse the path name in the link, which always requires reading additional inodes and generally requires reading other, and potentially many, directories, processing both the list of files and the inodes of each of them until it finds a match with the link's path components. Only when a link points to a file in the same directory do "fast symlinks" provide significantly better performance than other symlinks.
The vast majority of POSIX-compliant implementations use fast symlinks. However, the
POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
standard does not require the entire set of file status information common to regular files to be implemented for symlinks. This allows implementations to use other solutions, such as storing symlink data in directory entries.
The
file system permissions
Typically, a file system maintains permission settings for each stored item commonly files and directories that either grant or deny the ability to manipulate file system items. Often the settings allow controlling access based on function s ...
of a symbolic link are not used; the access modes of the target file are controlled by the target file's own permissions. Some operating systems, such as FreeBSD, offer the ability to modify file permissions and filesystem attributes of a symbolic link, through
lchmod
and
lchflags
system calls respectively.
The reported size of a symlink is the number of characters in the path it points to.
Error handling
A traditional
Unix filesystem
In Unix and operating systems inspired by it, the file system is considered a central component of the operating system. It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental ...
has a tree structure,
however symbolic links allow it to contain loops.
Microsoft Windows
NTFS symbolic link
NTFS
NT File System (NTFS) (commonly called ''New Technology File System'') is a proprietary journaling file system developed by Microsoft in the 1990s.
It was developed to overcome scalability, security and other limitations with File Allocation Tabl ...
3.1 introduced support for symbolic links for any type of file. It was included with
Windows XP
Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
, but was only enabled by default for kernel-mode apps.
Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
and later versions of Windows enabled support for symbolic links to user-mode applications. The
mklink
internal command of
Windows Command Prompt
cmd.exe, a.k.a. Command Prompt, is a shell (computing), shell computer program, program on later versions of Windows (Windows NT, NT and Windows CE, CE families), OS/2,, eComStation, ArcaOS, and ReactOS. In some versions of Windows (Windows C ...
can create symbolic links. Third-party drivers are required to enable support for NTFS symbolic links in Windows XP. Unlike
junction points, a symbolic link can also point to a file or remote
Server Message Block
Server Message Block (SMB) is a communication protocol used to share files, printers, serial ports, and miscellaneous communications between nodes on a network. On Microsoft Windows, the SMB implementation consists of two vaguely named Windows ...
(SMB) network path. Additionally, the NTFS symbolic link implementation provides full support for cross-filesystem links. However, the functionality enabling cross-host symbolic links requires that the remote system also support them.
Symbolic links are designed to aid in migration and application compatibility with
POSIX
The Portable Operating System Interface (POSIX; ) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines application programming interfaces (APIs), along with comm ...
operating systems. Microsoft aimed for Windows Vista's symbolic links to "function just like UNIX links". However, the implementation differs from Unix symbolic links in several ways. For example, Windows Vista users must manually indicate when creating a symbolic link whether it is a file or a directory. Windows 7 and Vista support a maximum of 31
reparse points (and therefore symbolic links) for a given path (i.e. any given path can have at most 31 indirections before Windows gives up). Only users with the new ''Create Symbolic Link'' privilege, which only administrators have by default, can create symbolic links. If this is not the desired behavior, it must be changed in the Local Security Policy management console. Additionally, NTFS symbolic links to files are distinct from NTFS symbolic links to directories and therefore cannot be used interchangeably, unlike on POSIX where the same symbolic link can refer to either files or directories.
In Windows Vista and later, when the working directory path ends with a symbolic link, the current parent path reference, , will refer to the parent directory of the symbolic link rather than that of its target. This behavior is also found at the shell level in at least some POSIX systems, including
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, but never in accessing files and directories through operating system calls. For instance, bash builtin commands and operate on the current logical directory. is often used in scripts to determine the actual current working directory. When any path is used with a system call, any use of will use the actual filesystem parent of the directory containing the pseudo-directory entry. So, and may return completely different results.
Examples
The following examples both create a symbolic link called "Downloads" at "E:\" that points to the Downloads folder in the current user's profile.
* The first example works in
Windows Command Prompt
cmd.exe, a.k.a. Command Prompt, is a shell (computing), shell computer program, program on later versions of Windows (Windows NT, NT and Windows CE, CE families), OS/2,, eComStation, ArcaOS, and ReactOS. In some versions of Windows (Windows C ...
only because
mklink
is an internal command.
:
mklink /D E:\Downloads %UserProfile%\Downloads
* The second example works in
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
only because New-Item is an internal cmdlet.
:
New-Item -Path 'E:\Downloads' -ItemType 'SymbolicLink' -Value "$Env:UserProfile\Downloads"
NTFS junction points
The
Windows 2000
Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
introduced
NTFS reparse points, which enabled the use of
NTFS volume mount points and junction points. Junction points are soft links to machine-local directories (junction points to remote shares are unsupported).
The Windows 2000 and XP Resource Kits include a program called
linkd.exe
to create junction points. A more powerful one named
Junction.exe
is distributed as a part of Microsoft Sysinternals Suite.
The tools introduced above (
mklink
and
New-Item
) also support creating junction points.
Not all standard applications support reparse points. Most noticeably, Windows Backup suffers from this problem and will issue an error message 0x80070003 when the folders to be backed up contain a reparse point.
Shortcuts
Shortcuts, which are supported by the graphical file browsers of some operating systems, may resemble symbolic links but differ in a number of important ways. One difference is what type of software is able to follow them:
* Symbolic links are automatically resolved by the file system. Any software program, upon accessing a symbolic link, will see the target instead, whether the program is aware of symbolic links or not.
* Shortcuts are treated like ordinary files by the file system and by software programs that are not aware of them. Only software programs that understand shortcuts (such as the Windows shell and file browsers) treat them as references to other files.
The mechanisms also have different capabilities:
*
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
shortcuts normally refer to a destination by an
absolute path
A path (or filepath, file path, pathname, or similar) is a text string that uniquely specifies an item in a hierarchical file system. Generally, a path is composed of directory names, special directory specifiers and optionally a filename, separ ...
(starting from the
root directory
In a Computing, computer file system, and primarily used in the Unix and Unix-like operating systems, the root directory is the first or top-most Directory (computing), directory in a hierarchy. It can be likened to the trunk of a Tree (data st ...
), whereas POSIX symbolic links can refer to destinations via either an absolute or a
relative path. The latter is useful if both the symlink and its target share some common ancestor path which is not known at creation (e.g., in an
archive file
In computing, an archive file stores the content of one or more files, possibly compressed, with associated metadata such as file name, directory structure, error detection and correction information, commentary, compressed data archives, sto ...
that can be unpacked anywhere).
* Microsoft Windows application shortcuts contain additional metadata that can be associated with the destination, whereas POSIX symbolic links are just strings that will be interpreted as absolute or relative pathnames.
* Unlike symbolic links, Windows shortcuts maintain their references to their targets even when the target is moved or renamed. Windows domain clients may subscribe to a
Windows service
In Windows NT operating systems, a Windows service is a computer program that operates in the background. It is similar in concept to a Unix daemon. A Windows service must conform to the interface rules and protocols of the Service Control Manag ...
called Distributed Link Tracking to track the changes in files and folders to which they are interested. The service maintains the integrity of shortcuts, even when files and folders are moved across the network. Additionally, in Windows 9x and later,
Windows shell
The Windows shell is the graphical user interface for the Microsoft Windows operating system. Its readily identifiable elements consist of the desktop, the taskbar, the Start menu, the task switcher and the AutoPlay feature. On some versions of ...
tries to find the target of a broken shortcut before proposing to delete it.
Folder shortcuts
Almost like shortcuts, but transparent to the Windows shell. They are implemented as ordinary folders (which need to have the ''read only'' and/or ''system'' attribute) containing a shortcut named ''target.lnk'' which refers to the target and a (hidden) ''desktop.ini'' with (at least) the following contents:
ShellClassInfoCLSID2=
Folder shortcuts are created and used from the Windows shell in the ''network neighborhood'' for example.
Shell objects
The ''shell objects'' or ''shell folders'' are defined in the Windows registry and can be used to implement a sort of symbolic link too. Like folder shortcuts, they are transparent to the Windows shell.
A minimal implementation is (the CLSID ' is used as a placeholder):
KEY_CLASSES_ROOT\CLSID\@="display name"
KEY_CLASSES_ROOT\CLSID\\DefaultIcon@="..." ; path to icon
KEY_CLASSES_ROOT\CLSID\\InProcServer32@="%SystemRoot%\\System32\\ShDocVw.Dll"
"ThreadingModel"="Apartment"
KEY_CLASSES_ROOT\CLSID\\Instance"CLSID"=""
KEY_CLASSES_ROOT\CLSID\\Instance\InitPropertyBag"Attributes"=hex:15,00,00,00
"Target"="..." ; absolute (WITHOUT "TargetKnownFolder" or "TargetSpecialFolder" only)
; or relative path to target
"TargetKnownFolder"="" ; GUID of target folder, Windows Vista and later
"TargetSpecialFolder"="0x00xy" ; CSIDL of target
KEY_CLASSES_ROOT\CLSID\\ShellFolder"Attributes"=hex:00,00,00,00
The ''My Documents'' folder on the ''Desktop'' as well as the ''Fonts'' and the ''Administrative Tools'' folders in the ''Control Panel'' are examples of ''shell objects'' redirected to file-system folders.
Cygwin symbolic links
Cygwin
Cygwin ( ) is a free and open-source Unix-like environment and command-line interface (CLI) for Microsoft Windows. The project also provides a software repository containing open-source packages. Cygwin allows source code for Unix-like operati ...
simulates POSIX-compliant symbolic links in the Microsoft Windows file system. It uses identical programming and user utility interfaces as Unix (see above), but creates Windows shortcuts (.lnk files) with additional information used by Cygwin at the time of symlink resolution. Cygwin symlinks are compliant with the POSIX standard in terms of how they are resolved, and with Windows standards in terms of their on-disk representation.
Additionally, Cygwin can be set up to support native Windows symbolic links which can be used out of Cygwin without restrictions.
This requires:
# Changing the CYGWIN environment variable to contain ;
# Running the Cygwin with elevated rights because Windows restricts the creation of symbolic links to privileged users
Some differences exist, however. Cygwin has no way to specify shortcut-related information – such as working directory or icon – as there is no place for such parameters in
ln -s
command. To create standard Microsoft .lnk files Cygwin provides the
mkshortcut
and
readshortcut
utilities.
The Cygwin User's Guide has more information on this topic.
MSYS2, which is based on Cygwin, has a similar set of settings but defaults to copying the files.
Comparison of POSIX and Windows symbolic links
Other implementations
Implementations of features similar to symbolic links.
Early MIT
MIT
The Massachusetts Institute of Technology (MIT) is a private research university in Cambridge, Massachusetts, United States. Established in 1861, MIT has played a significant role in the development of many areas of modern technology and sc ...
Compatible Time-Sharing System
The Compatible Time-Sharing System (CTSS) was the first general purpose time-sharing operating system. Compatible Time Sharing referred to time sharing which was compatible with batch processing; it could offer both time sharing and batch proce ...
and
Incompatible Timesharing System
Incompatible Timesharing System (ITS) is a time-sharing operating system developed principally by the MIT Artificial Intelligence Laboratory, with help from Project MAC. The name is the jocular complement of the MIT Compatible Time-Sharing Syste ...
both have linked files where the name of the target file is specified in a directory entry.
Data General RDOS
Data General
Data General Corporation was an early minicomputer firm formed in 1968. Three of the four founders were former employees of Digital Equipment Corporation (DEC).
Their first product, 1969's Data General Nova, was a 16-bit minicomputer intended to ...
's
RDOS for its
Nova
A nova ( novae or novas) is a transient astronomical event that causes the sudden appearance of a bright, apparently "new" star (hence the name "nova", Latin for "new") that slowly fades over weeks or months. All observed novae involve white ...
computers supports "link entries", which are directory entries that contain both the name of the entry and the name of another file, so that a reference to a file using the name of the entry refers to the other file.
Amiga
The command creating symbolic links is
makelink
, which is also used for hard links. Internally the dos.library returns an error code indicating that a target is a soft link if you try to perform actions on it that are only legal for a file, and applications that wish to follow the symbolic link then needs to explicitly make a call to follow the link and retry the operation. The
AmigaDOS
AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file Redirection (computing), redirection.
In AmigaOS 1.x, AmigaDOS is based on a TRIPOS port by ...
shell will follow links automatically.
Mac OS
In Mac OS, applications or users can also employ ''
aliases
A pseudonym (; ) or alias () is a fictitious name that a person assumes for a particular purpose, which differs from their original or true meaning (orthonym). This also differs from a new name that entirely or legally replaces an individual's ow ...
'', which have the added feature of following the target, even if it is moved to another location on the same volume. This is not to be confused with the shell command
alias.
OS/2
In the
OS/2
OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
operating system, symbolic links somewhat resemble
shadows
A shadow is a dark area on a surface where light from a light source is blocked by an object. In contrast, shade occupies the three-dimensional volume behind an object with light in front of it. The cross-section of a shadow is a two-dimensiona ...
in the graphical
Workplace Shell
The Workplace Shell (WPS) is an object-oriented desktop shell (also called desktop environment) produced by IBM's Boca Raton development lab for OS/2 2.0. It is based on Common User Access and made a radical shift away from the Program Manager t ...
. However, shadows, due to the fully object-oriented System Object Model, are considerably more powerful and robust than a simple link. For example, shadows do not lose their capabilities when renamed or when either the object or subject of the link is relocated.
Variable symbolic links
Symbolic links may be implemented in a context-dependent or variable fashion, such that the link points to varying targets depending on a configuration parameter, run-time parameter, or other instantaneous condition.
A ''variable'' or ''variant symbolic link'' is a symbolic link that has a variable name embedded in it. This allows some flexibility in filesystem order that is not possible with a standard symbolic link. Variables embedded in a symbolic link may include user and environment specific information.
Operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s that make use of variant symbolic links include
NetBSD
NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was fork (software development), forked. It continues to ...
,
DragonFly BSD
DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on DragonFly BSD in ...
,
Domain/OS
Domain/OS is the discontinued operating system used by the Apollo/Domain line of workstations manufactured by Apollo Computer. It was originally launched in 1981 as AEGIS, and was rebranded to Domain/OS in 1988 when Unix environments were added ...
.
Tru64
Tru64 UNIX is a discontinued 64-bit UNIX operating system for the Alpha instruction set architecture (ISA), currently owned by Hewlett-Packard (HP). Previously, Tru64 UNIX was a product of Compaq, and before that, Digital Equipment Corporation (DE ...
uses a ''context dependent symbolic link'' where the context is the cluster member number.
Pyramid Technology
Pyramid Technology Corporation was a computer company that produced a number of RISC-based minicomputers at the upper end of the performance range. It was based in the San Francisco Bay Area of California
They also became the second company to s ...
's OSx operating system implemented ''conditional symbolic links'' which pointed to different locations depending on which
universe
The universe is all of space and time and their contents. It comprises all of existence, any fundamental interaction, physical process and physical constant, and therefore all forms of matter and energy, and the structures they form, from s ...
a program was running in. The universes supported were AT&Ts's
SysV.3 and the
Berkeley Software Distribution
The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginn ...
(BSD 4.3). For example: if the
ps command was run in the ''att'' universe, then the symbolic link for the directory ''/bin'' would point to ''/.attbin'' and the program ''/.attbin/ps'' would be executed. Whereas if the ps command was run in the ''ucb'' universe, then ''/bin'' would point to ''/.ucbbin'' and ''/.ucbbin/ps'' would be executed. Similar Conditional Symbolic Links were also created for other directories such as ''/lib'', ''/usr/lib'', ''/usr/include''.
See also
*
Symlink race — a security-vulnerability caused by symbolic links
*
freedup — generates links between identical data automatically
*
Pointer (computer programming)
In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer ''re ...
References
External links
Q & A: The difference between hard and soft linksas applied to Linux
Junction maintain NTFS junction points (for Windows 2000 and above)
FSUtil Hardlink Microsoft Technet page on using the command-line tool FSUtil to create hardlinks (for Windows 2000 and above)
: file system drivers to enable Symbolic Links for Windows XP (also mirrored on Link Shell Extension site). Sources available.
{{File systems
Computer file systems
Unix file system technology