Home

symlinks

A symbolic link, or symlink, is a special kind of file that serves as a reference to another file or directory. It contains a pathname to the target rather than the data of the target itself. When a program accesses a symlink, the operating system transparently follows the path to the target. If the target is moved or deleted, the symlink may become dangling and no longer resolves to a valid object.

Symlinks are distinct from hard links. A hard link is another directory entry that points to the

Resolution and behavior depend on the system. Many Unix-like systems offer readlink or similar utilities to

Creation and removal are straightforward. In Unix-like environments, the command ln -s target link creates a

Common uses include aliasing long paths, redirecting libraries or data directories, and enabling flexible package layouts.

same
underlying
inode
as
the
target;
a
symlink
is
a
separate
file
that
points
to
a
pathname.
Symlinks
can
cross
filesystem
boundaries
and
can
reference
directories,
whereas
hard
links
typically
cannot
cross
file
system
boundaries
and
are
usually
not
used
for
directories.
obtain
the
target
path.
System
calls
like
stat
and
lstat
differ
in
how
they
treat
symlinks:
stat
follows
the
link
to
the
target,
while
lstat
reports
the
link
itself.
Symlinks
can
point
to
absolute
or
relative
paths;
relative
targets
are
resolved
relative
to
the
link’s
location.
symlink
named
link
that
points
to
target;
removing
the
link
(rm
link)
deletes
only
the
link,
not
the
target.
On
Windows,
symbolic
links
can
be
created
with
mklink,
with
differences
for
files
and
directories,
and
there
are
also
junctions
that
behave
differently.
Potential
issues
include
broken
or
circular
links,
security
concerns
when
following
links
in
web
servers
or
sandboxed
environments,
and
portability
considerations
when
moving
data
between
systems.