The ln command

make links between files 2 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-s, --symbolic
make symbolic links instead of hard links
-f, --force
remove existing destination files
-n, --no-dereference
treat LINK_NAME as a normal file if it is a symbolic link to a directory

Examples

sudo ln -s /etc/nginx/sites-available/shop /etc/nginx/sites-enabled/
ln -sfn /var/www/releases/v2 /var/www/current

Point the link elsewhere (-f replace, -n the link itself)

Lessons that use ln