Hard link vs Symbolic link

Ahlemkaabi
2 min readFeb 2, 2021

--

What are hard and symbolic links on Linux ?

Hard link and symbolic link are like a copy for an original file. But they are not just a copy, each one of them has its own specification. Read below for more details.

What is the difference between hard link and symbolic link?

The hard link have a different name of the original file whereas the symbolic link is just a pointer to the original file (have the same name).

When you modify a hard link file you are changing the content the original file, but when it comes to the symbolic link it is the opposite.
The hard link file has the same size of its original file, the symbolic link is smaller than its original file.
For the hard link, if the original file is deleted the hard links will still contain the data that were in the original file.
For the symbolic link, if we delete the original file the symbolic link will become useless.

How to create hard link and symbolic link?

Create hard link between ori_file and link_file, run:

hard link

To make symbolic links instead of hard links, use:

symbolic link

To verify soft or hard links on Linux, run:

Verify

--

--

No responses yet