Hard Links

In this lesson, we learn about hard links and also the reason for using unlink() to remove a file.

We'll cover the following

We now come back to the mystery of why removing a file is performed via unlink(), by understanding a new way to make an entry in the file system tree, through a system call known as link(). The link() system call takes two arguments, an old pathname and a new one; when you “link” a new file name to an old one, you essentially create another way to refer to the same file. The command-line program ln is used to do this, as we see in this example:

Get hands-on with 1200+ tech skills courses.