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

Today we are with a concern that I know many of us have reached this point, which is what is the difference between the hard link and symbolic link.
let’s start by defining each one with a theoretical concept that we can draw from this information.

which is a symbolic link?

Symbolic link. In computing, a symbolic link, on Unix or GNU/Linux systems, indicates access to a directory or file that is in a different location within the directory structure.

then let’s feedback a symbolic link is simply what we do in windows when we create a shortcut, let’s see a brief example with this image.

as we can see they are symbolic links when joining them they are going to send us to the real location or to the program as such, in Linux it happens the same thing we can create a symbolic link of a file and we call it with the name that we put to the link.

which is a hard link?

Hard links, associate two or more files sharing the same inode. This makes each hard link an exact copy of the rest of the associated files, both data, and permissions, proprietary.

actually, this image is very explicit a hard link takes us straight to the data on the disk. Although it speaks of an inode, an inode is a data structure, so to speak a table containing information about a file.

So what’s the difference between these two?

then we could say that a symbolic link takes us to the original file and the hard link creates the same file with all permissions and sends you directly to the data in the system.

I hope you’ve been able to understand this, don’t forget the limits to learning, you put them on yourself.

Software Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store