Symbolic link command – Linux

Symbolic links point to files and folders.

Let’s say you log in and are now at /home/user. /var/www/html is far from your current location and you may think it is a pain to access by specifying the absolute path. That is where symbolic link comes in handy.

Command

ln -s [source] [link] (file or directory)

Example

To create a link named “test” at /home/user which points to /var/www/html, enter the following command:

$ln -s /var/www/html /home/user/test

$cd /home/user/test

Now you can access /var/www/html from the link.

This post is also available in other languages.