Symbolic links and Hard links!

luiscarvajal
2 min readJun 9, 2020

Symbolic links.

A very useful feature in linux is symbolic links, this allows us to have a file referenced by various names. Regardless of the original file name, symbolic links allow us to generate something very similar to “shortcuts” in Windows OS which is better known but much more recent.

Besides that, it allows us to bring different versions of the same program installed, just referencing the version of the program with a symbolic link.

Symbolic links contain text pointing to the linked file or directories.

we can make a symbolic link with the command “ln”

ln -s name_file name_sym-sym

Hard links.

when creating a hard link an additional entry is created to the file that by default, each file comes with a single hard link when creating it since they are the original way of creating links in unix.

This type of link is stricter since it only shows files that are not in the same file structure, it must even be in the same disk partition and also cannot be used to link directories.

we make a hard link with the same “ln”

ln name_file name_hardLink-hard

we can see how hard disk is more restricted and older since its creation.

by: Luis Carvajal

--

--