Olivier Guyot
2 min readSep 14, 2020

--

An hard link and a symbolic link are different , here the explanation !

If you are used to linux system you have already heard about Symbolic and Hard link.

First how to create a Soft and an hard link?

In order to create a soft link you can use the command ls -s

$ ln -s filename linkname

In order to create an hard link you can use the command ls

$ ln filename linkname

GOOD i can create 2 different type of link but what’s the difference?

An hard link change the content

An hard link is a directory entry which is directly associate to a file. We can have different Hard link which point to the same file.

An hard link is more or less directly link to the content of the file so this will have one major effect. If we changed the content of a file through an hard link, the content will be changed definitively.

A symbolic link does not change the content

Like an Hard link, a symbolic links is a special file which points to another file on the system but a change on it will not change the content of the file.

I am sure you have already use a shorcut or an alias in windows or Mac os. A symbolic links is similar.

Like a short cut the symbolic link does not contain the data of the file it only contains his name and the location of the linked file. So instead of the hard link, if we change the content of a symbolic link, the original content file will not changed.

Thank you for reading, do not hesitate to share or to contact me.

--

--