Hard links and symbolic links are useful tools, but they are often confused. A hard link is a file by another name. A symbolic link is like a shortcut, its not the whole file but it points to the actual file.
Links interact with the inode, the inode is like the index of the file. It contains the information the computer needs to find the file, it contains the parent directory, the children of itself if its a directory, and the read write permissions among other things. All inodes have a number that they are associated with.
When you create a hard link it creates a new file name that points to the existing inode number. So I could write ln Bob Fred,(ln is the command for making a link) and now Bob is pointing to the same inode as Fred. Where Bob is the source file and Fred is the target file.
If you delete a hard link it only deletes that name for the file, not the whole file, ( unless its the last hard link in which case it will delete the whole file). However if you delete the actual file then a symbolic link will no longer function. You can delete a link itself and preserve the file. You can do this by using rm (remove ) and then the link name as a symbolic link is actually a file that points to the real file. You can also use the unlink command to remove an unwanted link.
Only symbolic links can point across directories. This is a limitation of hard links, they can only point to files in their path. While symbolic links can be present anywhere the system does not forbid them. So say I have a file named “really long file” and I do not want to type it in every time, I have two options I could move to its directory and create a hard link (ln “really long file” rlf) or I could create a symbolic link (ln -s “really long file” rlf) the symbolic link can be anywhere. Either way will allow me to access the file via the new name.
With a hard link if you change the file permissions (the ability to read, write and execute by a given user) then the files permissions will also change. Where as with a symbolic link the permissions will not be the same as the file and can be set independently.
There are pros and cons of both symbolic links and hard links, and depending on the situation one might be better then the other. For example lets say I have a game, and I want the user to not be able to write to the file, I could create a symbolic link with only execute and read permissions. I could then allow the user to know about said symbolic link, this way there is no accidental writing to the file. This is but one simple example, there are many uses to hard and symbolic links.