What is the difference between a hard link and a symbolic link?

Yosri Bouabid
1 min readFeb 5, 2020

We use files every day for multiple reasons, so we need a more efficient way we can manipulate them even if the file is located on another directory or server.

So we use links, there are a two different types of links we can create for different usage and results.

1- Hard Links:

It make the file like a mirror of the original file where we have the same permission just like the original, this file will have the actual content of original file so that you still can view the contents, even if the original has been removed or moved, but it will only work on files.

It can be created using the command ln:

ln file link

file: name of the new file

link: name of the hard link.

2- Symbolic (soft) Link:

Unlike the hard link the symbolic link doesn’t have the content of the original file, it’s just a path in between, with different permission, in case the original file has been removed or moved the symbolic file will be unavailable.

the command to create a symbolic link:

ln -s file slink

-s: to make the link symbolic instead of hard

slink: name of the hard.

--

--