Q: How do I make a link to a directory so that I don't have to type the long path name every time?


A: Links are shortcuts for linking directories.  If you have a directory that you routinely access, but do not want to type out the pathname every time you do so, create a link. This operation creates a shortened name for the true pathname that appears in your directory much like a sub directory, and these shortened names are called links.

If you use a directory often, instead of typing this (for example):

cd /data/geoglab/g373/username

to get from your home directory to the user's g373 directory, you can execute the following command:

ln -s /data/geoglab/g373/username newname

to create the link within your home directory.  The new directory name should be something easy for you to remember what the directory is.  In the above example, a good name for the link might simply be g373, indicating that the directory link goes to the user's g373 class workspace. To see your new link, type "ls." You should see a file named "newame@". The '@' symbol designates the file as a link.  The link will act as a subdirectory.  Thus, to use your link to get to the other directory, type:

cd newname

(You do not need to type the "@"). This will bring you to /data/geoglab/g373/username without having to type the entire pathname. Now you may do the same for other directories, using the command structure:

ln -s /path linkname
To destroy your link, type:
rm linkname

It is important that you remember the true path name of the directory for which you are creating the link. If you are not comfortable with this, or if you do not understand UNIX file structure, you may not wish to use this command.