Symbolic VS Hard Links

Hard links are the original Unix way of creating a link.  By defaults, every file has a single hard link that gives the file its name. When we create a hard link, we create an additional directory entry for a file. Hard links have two important limitations.

  1. Hard links cannot reference a file outside its own file filesystem.
  2. A hard link cannot reference a directory

Keep in mind that a directory list containing a hard link will not show any special indication of the link or links. And, when a hard link is deleted, the contents of the file will continue to exist.. Unless space is deallocated.

Symbolic links are the new and more modern way of creating links. Symbolic Links were created to overcome the limitations of hard links..two distinct disadvantages are:

  1.  Hard links cannot span physical devices
  2.  Hard links cannot reference directories, only files.

Symbolic links are a special type of file that contains a text pointer to the target file or directory. Creating them is similar to creating a hard link. (We’ll talk about that later on) If you write something to a symbolic link, a reference file will be written as well. If the symbolic link is deleted, only the link is deleted. If a file is deleted, then the link will continue to exist. However, the link will point to nothing.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s