Breadcrumbs 
Learning >> Documentation >> File System >> Symbolic links (ln)
 
Recent News
We Want You!
Come and get involved! (And Christmas Party!
[ more ]
Make your own Xbox games!
Learn to make Xbox 360 games
[ more ]
New Committee
A new committee has been appointed.
[ 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