Breadcrumbs 
Learning >> Documentation >> File System >> Symbolic links (ln)
 
Recent News
We're No 1!
We've reached the top! (Of Google!)
[ more ]
Firefox 3 Download Day
Firefox 3 has been officially released and is looking to set a world record for the most downloaded piece of software in 24hrs.
[ more ]
SSL Renewed
SSL cert has been renewed by the admin team.
[ more ]
Symbolic Links
Symbolic Links

ln [target] [linkname]

This is one of the most useful commands. It is more commonly called a "symlink" and allows you to create shortcuts of your own.

$ ln -s gallery142 newphotos

This creates a shortcut or link called "newphotos" which points at the directory gallery142. This also works for files. You can check where a symlink goes to as follows:

$ ls -l
drwx------ 3 roryd users 4096 Aug 14 14:48 gallery142
lrwxrwxrwx 1 roryd users 11 Aug 20 01:19 newphotos -> gallery142

You can then use it as if it were a normal directory. In this example, we see the symlink at work.

# check the files in the gallery folder
$ cd gallery142
$ ls
photo1.jpg photo2.jpg photo3.jpg

# go back up one directory and into the symlink directory
$ cd ../newphotos
$ ls
photo1.jpg photo2.jpg photo3.jpg