next up previous contents
Next: A last note Up: Crossreferences to Files: Previous: Hard Links

Soft Links

To create a soft link we use the same command we use to create a hard link, except that we use the -s flag. Again we make a link from a source name to a destination name. Let's create a soft link:

$ln -s a e
$ls -F
a          c          data/      junk/
b          d          e@         programs/
$ls -l
total 3
-rw-------   2 markst   staff           0 Jan 21 17:13 a
-rw-------   1 markst   staff           0 Jan 21 17:07 b
-rw-------   1 markst   staff           0 Jan 21 17:07 c
-rw-------   2 markst   staff           0 Jan 21 17:13 d
drwx------   3 markst   staff        1024 Feb  6 20:47 data/
lrwxrwxrwx   1 markst   staff           1 Mar  5 20:03 e -> a
drwx------   2 markst   staff        1024 Jan 21 17:11 junk/
drwx------   2 markst   staff        1024 Feb  6 21:16 programs/
$

In the short directory listing our new soft link has been marked with a '', to show it is a soft link. In our long directory listing we can see 'e' is a link by the link attribute in the first column and by the '-> a' which shows where the link goes to.



Mark O. Stitson
Wed Sep 25 10:45:32 BST 1996