ln

ln(1) is used to create links between files. These links can be either hard links or soft (symbolic) links. The differences between the two kinds of links were discussed in the section called Links in Chapter 9. If you wanted to make a symbolic link to the directory /var/media/mp3 and place the link in your home directory, you would do this:

   $ ln -s /var/media/mp3 ~/mp3
   

The -s option tells ln to make a symbolic link. The next option is the target of the link, and the final option is what to call the link. In this case, it will just make a file called mp3 in your home directory that points to /var/media/mp3. You can call the link itself whatever you want by just changing the last option.

Making a hard link is just as simple. All you have to do is leave off the -s option. Making a hard link out of the previous command would be done as follows:

   $ ln /var/media/mp3 ~/mp3