A hard link is effectively an identical replica of the file, therefore the hard link and the actual file will both have the same inode. A soft link, also known as a symbolic link, functions similarly to a shortcut or pointer to a file. It is not an exact replica of the file, but rather a pointer to the original. The inode values of a soft link to a file and the real file will differ. Furthermore, you will not be able to access the contents of the soft link if you remove the actual file. In this article, we will learn more about soft links and hard links.

We have a file shortcut feature in windows that is used to create a shortcut for files. A soft link is similar to a file shortcut. Each soft-linked file has its own Inode value, which refers to the original file. Any changes to the information in one file are mirrored in the other. You can connect soft links across different file systems, but if the source file is removed or transferred, the soft-linked file will not function properly. This link is called a hanging link. Removing a soft link has no effect, but If you remove the original file, it may cause the link will stop working. A soft link may be used to point to a directory and it just retains the path to the original file, not its contents. The size of the soft link will be equal to the file for which the soft link is formed. For example, if the file theabcd.txt is 5KB, the soft link of this file will be also 5KB. A soft link:

may traverse the file system, allow you to connect across directories, has different file permissions and inode than the original file, permissions will not be modified, and has just the original file’s path, not its contents

A hard link in Linux is equivalent to a file saved on a hard drive – and it really refers to or links to a location on a hard drive. A hard link is essentially a mirror image of the original file. The difference between a hard link and a soft link is that removing the source file has no effect on a hard link but makes a soft link unworkable. So the most significant benefit of making a hard link is that you can still access the contents of the file even if you unintentionally erase it. A hard link:

can’t traverse file system borders, can’t connect directories, has the same file permissions and inode number as the original file If we alter the permissions of the source file, permissions will be changed for the hard link too contains the content of the original file, even if the original file is destroyed you can access the content.

Check the below screenshot of Inode differences between Hard link and Soft link files:

Let’s understand the differences with a quick practice. Create a simple text file in a directory and name it file1.txt. We will create a soft link and a hard link for this file.

Wrapping up

A hard link takes up less space and works faster, but the modifications made to it are reflected in the original file. Whereas, Soft links need more space, any changes to the soft link have no effect on the original file. Unlike hard links, soft connections to directories are permitted.

What are Soft Links and Hard Links in Linux    TecAdmin - 94What are Soft Links and Hard Links in Linux    TecAdmin - 55


title: “What Are Soft Links And Hard Links In Linux Tecadmin” ShowToc: true date: “2022-11-21” author: “Edwin Kirk”


A hard link is effectively an identical replica of the file, therefore the hard link and the actual file will both have the same inode. A soft link, also known as a symbolic link, functions similarly to a shortcut or pointer to a file. It is not an exact replica of the file, but rather a pointer to the original. The inode values of a soft link to a file and the real file will differ. Furthermore, you will not be able to access the contents of the soft link if you remove the actual file. In this article, we will learn more about soft links and hard links.

We have a file shortcut feature in windows that is used to create a shortcut for files. A soft link is similar to a file shortcut. Each soft-linked file has its own Inode value, which refers to the original file. Any changes to the information in one file are mirrored in the other. You can connect soft links across different file systems, but if the source file is removed or transferred, the soft-linked file will not function properly. This link is called a hanging link. Removing a soft link has no effect, but If you remove the original file, it may cause the link will stop working. A soft link may be used to point to a directory and it just retains the path to the original file, not its contents. The size of the soft link will be equal to the file for which the soft link is formed. For example, if the file theabcd.txt is 5KB, the soft link of this file will be also 5KB. A soft link:

may traverse the file system, allow you to connect across directories, has different file permissions and inode than the original file, permissions will not be modified, and has just the original file’s path, not its contents

A hard link in Linux is equivalent to a file saved on a hard drive – and it really refers to or links to a location on a hard drive. A hard link is essentially a mirror image of the original file. The difference between a hard link and a soft link is that removing the source file has no effect on a hard link but makes a soft link unworkable. So the most significant benefit of making a hard link is that you can still access the contents of the file even if you unintentionally erase it. A hard link:

can’t traverse file system borders, can’t connect directories, has the same file permissions and inode number as the original file If we alter the permissions of the source file, permissions will be changed for the hard link too contains the content of the original file, even if the original file is destroyed you can access the content.

Check the below screenshot of Inode differences between Hard link and Soft link files:

Let’s understand the differences with a quick practice. Create a simple text file in a directory and name it file1.txt. We will create a soft link and a hard link for this file.

Wrapping up

A hard link takes up less space and works faster, but the modifications made to it are reflected in the original file. Whereas, Soft links need more space, any changes to the soft link have no effect on the original file. Unlike hard links, soft connections to directories are permitted.

What are Soft Links and Hard Links in Linux    TecAdmin - 96What are Soft Links and Hard Links in Linux    TecAdmin - 86