As in windows, linux has a direct link with which you can access either a file or a directory in a simple way without the need to scroll through the entire directory hierarchy that contains either the file or the folder of interest.

An example of this on windows is: C: \ ProgramData \ Microsoft \ Device Stage \ Task \ {e35be42d-f742-4d96-a50a-1775fb1a7a42} \ en-US


The same example in linux would be: / C / ProgramData / Microsoft / Device Stage / Task / {e35be42d-f742-4d96-a50a-1775fb1a7a42} / en-US

When you see these two examples, you can see that when trying to access the desired path, the cd command that is used to enter folders is overloaded.For this, in Linux there is something called a link that doing the homologation would be the direct access that is on the desktop, which allows you access a file more quickly and it saves you from going to the address where the file you want to use is saved.

In this order in Linux there are 2 types of links: 

Physical Link (Hard): It refers to one of the many names that a file can have in different locations, since every time a file is copied to another address a new physical link is created, in this way a file does not ceases to exist until the last physical link has been removed. These physical links can only be created in files (archives) and not in directories (folders).

To create a physical link we will use the ln command with the following rules:

ln [source] [link name]

For example to create a physical link in our current location of the Price.php file found at

~ / Git / Bogota / app / Models / we will use:

ln ~ / Git / Bogota / app / Models / Price.php NewPrice.php

Symbolic Link (Soft): It is a way of referring to a specific file, this is called a pointer. If the file pointed to by this link is deleted, the symbolic link becomes unusable. 

To create a symbolic link, use the ln command with the following rules:

ln -s [source] [link name]

The syntax we use is the same as for the physical link with the difference that we add the -s option to indicate that we want to create a symbolic link.

For example if we want to create a symbolic link in our current location of the database folder which is located in

 ~ / GitLab / EDcampBogota2017 / database / we will use:

ln -s ~ / GitLab / EDcampBogota2017 / database MyDatabase

Comentarios