Linux link command

Updated: 04/26/2017 by Computer Hope

About link

Calls the link function to create a link to a file.


The link command creates a hard link named FILE2 which shares the same index node as the existing file FILE1. Since FILE1 and FILE2 share the same index node, they will point to the same data on the disk, and modifying one will be functionally the same as modifying the other.

This is distinct from creating a "soft" symbolic link to a file, which creates its own index node and therefore does not directly point to the same data.

For example, a user cannot create a hard link which links to a directory; but this can be accomplished using a symbolic link.

link syntax

link FILE1 FILE2



display help and exit.


display version information, and exit.

link examples

link computer.txt hope.txt

The above example would create the file hope.txt linked to the file computer.txt. Any changes that occurred with either of these files would affect the other file or link.

ln — Create a link, or a symbolic link, to a file or directory.
ls — List the contents of a directory or directories.
unlink — Remove a file.