What is a symlink?

Many of you may have come across the term symlink and must have wondered what that is? 

A symlink, also known as a symbolic link is nothing but a link to another file. Think of it as a shortcut in Windows or an alias in a mac. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file.

To create a symbolic link in a unix or linux environment, use the following command.

ln -s source_file myfile

Hope this helps understand symlinks better! ☺️

Previous
Previous

How to move a PostgresSQL Data Directory?

Next
Next

How to generate a self-signed certificate using OpenSSL?