Thursday, 28th August 2008
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:
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