Mastering Symbolic Links in Bash
A Quick Guide
I’ve come across the term “symbolic link” frequently, and not really understood exactly what that means. It’s shortened to symlink, and is one of the most powerful tools in the Bash command line toolkit.
So what are symbolic links, why should you use them and how do you create them?
Let’s take a deep dive.
Terminology
Symbolic link: this is a type of file that acts as a pointer to another file or directly.
Hard link: creates a mirror copy of a file. The pointer points directly to the data on the disk, and even if the original file is deleted the link will still work.
What is a Symbolic Link?
A symbolic link is a pointer for a file or a directory. That means it contains a reference to another file’s path, so in some sense is similar to a Windows shortcut.
Why use a Symbolic Link?
Symbolic links are helpful to keep file structures clean, manage different file versions or share configurations across multiple directories.
Since they help prevent duplication they save storage and make file access flexible.