A symbolic link is a way of saving disk space when the same file structure must exist
in two places. It's also a way of creating a short cut to another place. These
shortcuts are used quite often on ftp servers. For example, if you look at your
typical FreeBSD ftp server, you might see something like this:
ftp> cd /pub/FreeBSD
250 CWD command successful.
ftp> ls 3*
227 Entering Passive Mode (203,97,33,7,193,160)
150 Opening ASCII mode data connection for /bin/ls.
lrwxrwxrwx 1 0 1 25 May 9 22:29 3.1-RELEASE -> releases/i386/3.1-RELEASE
lrwxrwxrwx 1 0 1 25 May 9 22:29 3.1-STABLE -> releases/i386/3.1-RELEASE
lrwxrwxrwx 1 0 1 25 May 18 10:03 3.2-RELEASE -> releases/i386/3.2-RELEASE
226 Transfer complete.
You can see that the releases actually exist within a subdirectory. In case, the
links are relative to the current path. |
| You should see man
ln for full details. But here are a few practical examples. The
following demonstrates that /home is a shortcut for /usr/home.
# cd /
# ls -ld home
lrwxr-xr-x 1 root wheel 9 Jun 20 19:28 home -> /usr/home
This link could be created with:
# ln -s /usr/home /home
In this case the links are absolute, not relative as in the ftp server example. |