z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Creating a hard link

z/OS UNIX System Services User's Guide
SA23-2279-00

A hard link is a new name for an existing file. You cannot create a hard link to a directory, and you cannot create a hard link to a file on a different mounted file system.

All the hard link names for a file are of equal importance with its original name. They are all real names for the one original file. To create a hard link to a file, use this command format:
ln old new
Thus, new is the new path name for the existing file old. In Figure 1, /u/benson/proja is the new path name for the existing file /u/smitha/proja.
Figure 1. Hard link: a new name for an existing file. The hard link has an identical inode number.A file system structure with hard links.

When you create a hard link to a file, the new file name shares the inode number of the original physical file, as shown in Figure 1. Because an inode number represents a physical file in a specific file system, you cannot make hard links to other mounted file systems.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014