What is a hard link in Linux?
To use an analogy from mail delivery, a symbolic link is something like a forwarding address... when something tries to open a symbolic link, it opens the "file" (not literally a file, though) stored there, and sees that it should instead look at a file with a different name, so it opens the other file instead.
A hard link is more like having two addresses for the same place. (Of course this isn't really possible in the physical world). When something tries to read either file name (address), they get the same physical file (location).
So a hard link is not a copy, because the file is only stored once (but with multiple names). But it behaves very much like a copy, because you can access the same information from two file names.
No. A (second and all subsequent) hard link to a file is a pointer to the same inodes on disk.
When you make a hard link, it means the same file shows up in two different places. A file is really only a reference to a set of data blocks on disks, so a hard link adds another reference. Files are rarely truly deleted; the references are just removed so it's impossible to access the data. That's why when you delete a file you made as a hard link, the other original file stays, and vice versa.
On the other hand, a symlink is a direction to access a file with a certain name. It tells any programs, "If you want to use this file, it's over there". This is why if you delete the target of the symlink, the symlink breaks. And if you delete the link, the target is unaffected.
A file in *nix system has two parts. one the data portion and other is inode. inode stores meta (information relevant to the data like location where in HDD it is stored) information. The hard link makes creates a exact copy of this inode. While sym link creates a inode which points to the inode of the actual inode. So inode data in hardlink is same as target but different data in sym link. So to put the long story short, sym links and hard links differ by their content of inode data not the file data. This is my understanding of difference between sym link and hard link. I had a tough time initially understanding this as this is something more developer thingy and i am not a developer. Oh knowledgeable ones, please correct me if i am wrong.