Linux: hard links, part 0

Self-tutoring about Linux: the tutor mentions a couple of ideas about hard links.

In Linux, a hard link is another name for the linked file. It reads from the same disk location as the file’s original name. Moreover, if the original file also has another hard link to it, the file is still readable from that hard link, even after the file has been removed by its original name. Only when the other hard link is removed, as well, will the file be gone.

Let’s imagine you accidentally delete a file but it has another hard link. You can restore it by making a new hard link to the other one, naming the new one the original file name:

ln hardlinkname origname

That’s how I see it, anyway.

Source:

redhat.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply