Blessed symbolic links

Jair Guerrero
2 min readFeb 4, 2021

One of the characteristics that makes Linux very flexible is the links.

Some prefer to call the links as a shortcut; I prefer to say that they are a reference from one file to another. Based on the Windows operating system, if you create a shortcut; Opening it will take you directly to the location of your original file, while on Linux invoking the link will open the location where the link was created.

Assuming that in Windows you created the shortcut to the path C: \ Users \ SAENZ \ Documents \ VagrantBox, when you invoke the shortcut, it will open that location.
Whereas on Linux if you create a link in your home directory (~ / Holberton) that points to / data / Betty
When you open this link, you will be shown the location ~ / Holberton.

Types of links

In Linux there are two different types of links:

  • Hard links.
  • Symbolic links.

Symbolic links can link directories, refer to another file, they don’t work if the original file is deleted.
In addition to the above, physical links cannot link to directories only to files and will continue to work even if the original file is removed.

Command for symbolic link

The command to create a symbolic link is as follows

ln -s source_file_name myFile

--

--