Learning about Linux: Symbolic Links and How to Create Them

Ln command

What a good day, this time we will learn some basic Linux, symbolic links. For those who do not know the concept I will explain, the symbolic links (Symbolic link) they have been the equivalent to what are the shortcuts in Windows.

Symbolic links are more useful than shortcuts, since these can be used by programs to access or use the files to which the symbolic links point.


To start using symbolic links, we must access a terminal, we open it by typing ctrl + alt + to alt + f2 and we will use the ln command for creation from our link.

The way to use it is as follows:

ln -s origen destino

You can check the options offered by the ln command with the help of –help:

[darkcrizt@Darkcrizt-Lap]$ ln --help

Modo de empleo: ln [OPCIÓN]... [-T] OBJETIVO NOMBRE_DEL_ENLACE (1ª forma)

o bien: ln [OPCIÓN]... OBJETIVO (2ª forma)

o bien: ln [OPCIÓN]... OBJETIVO... DIRECTORIO (3ª forma)

o bien: ln [OPCIÓN]... -t DIRECTORIO OBJETIVO... (4ª forma)

A practical example that I am going to use is to create the symbolic link for my download folder on my desktop. In this case we do it on folders

It would be as follows:

ln -s /home/darkcrizt/Descargas /home/darkcrizt/Escritorio/descargas

For example, if I have a script that I want to run, but I want to avoid having to navigate to the folder where I have it saved, we can also create a symbolic link of it.

The example is this:

ln -s /home/darkcrizt/scripts/actualizar.sh /home/darkcrizt/Escritorio/script.sh

Finally, in order to know the path of a link, we can execute the following command on the place where we have the link:

[darkcrizt@Darkcrizt-Lap Escritorio]$ ls -l

total 0

lrwxrwxrwx 1 darkcrizt darkcrizt 25 feb 25 21:00 descargas -> /home/darkcrizt/Descargas

lrwxrwxrwx 1 darkcrizt darkcrizt 37 feb 25 21:15 script.sh -> /home/darkcrizt/scripts/actualizar.sh

[darkcrizt@Darkcrizt-Lap Escritorio]$

Without further ado, it only remains for you to start giving this small utility a chance, andso is everything until next 

 


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.