Create a symbolic link in Linux

The command ln is the one that creates the links.

What the -s flag does is create a symbolic link instead of a hard link. Symbolic link (symbolic link) and hard link (hard link) are two different ways to create links from one file to another. Actually both are references to the original file. The one we’re interested in doing here is the symlink version.

The way to create them is this:

sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

Changing the paths also works for Apache, since it has a similar working folder structure between sites-enabled and sites-available.

How to delete a symbolic link

Sometimes we also need to delete a symbolic link, for which we use the command link

sudo unlink /etc/nginx/sites-enabled/example.com

See also  Getting started with Livewire
Loading Facebook Comments ...
Loading Disqus Comments ...