Hard and Symbolic links: Concepts, How to create them and Differences

In this article we will explain some interesting things that Gnu-Linux user should know about links or shortcuts in Linux.

Hard Links

Hard links associate two or more files sharing the same inode.

  • The owner of the file and folder.
  • The location of the file or folder on our hard drive.
  • The creation date of the file or directory.
  • Etc.

How to create a Hard Link

First we will create a text file by executing the following command in the terminal: touch lex.txt

Symbolic or Soft Links

Symbolic link is similar to direct access in Windows and are the links that all common users use on a regular basis.

How to create a Symbolic Link

We are going to create a file called lex2.txt: touch lex2.txt

Differences between Hard and Symbolic Links

  • Hard links are exact copies of the file while symbolic links are pointers or “shortcuts”.
  • Hard links share the inode number, symbolic links don’t.
  • Symbolic links can be made with files and directories while hard links only between files.
  • Symbolic links can be made between different file systems, hard links cannot.
  • In symbolic links if the original file or directory is deleted, the information is lost, in hard links not

Bachelor Industrial Engineering