Creating links

A link is a new path name, or directory entry, for an existing file. The new directory entry can be in the same directory that holds the file or in a different directory. You can access the file under the old path name or the new one. After you have a link to a file, any changes you make to the file are evident when it is accessed under any other name.

You might want to create a link:
  • If a file is moved and you want users to be able to access the file under the old name.
  • As an alias: You can create a link with a short path name for a file that has a long path name.

You can use the ln command to create a hard link or a symbolic link. A file can have an unlimited number of links to it.