Want to Know: What Are Symbolic and Hard Links!?

If you’re someone who came here wanting to learn about a shortcut in Linux a little bit more about links on Linux, great! Let me try to break things down a little! Let’s start by thinking of our links in UNIX, as a “pointer” to a file or directory. Creating a link is like creating a shortcut. The shortcut points us directly to the file/directory we want to access.

More specifically, there are TWO types of links that we can use!

HARD LINKS

SYMBOLIC LINKS (also known as ‘soft’ links)

The main difference in these two links is the action taken when the source file/directory that the link is pointing to has been moved or removed. I will discuss the specifics behind what each link does when the source file/directory has been moved/removed and cases in which we would use each link.

HARD LINK

Use the syntax below to create a hard link:

SYMBOLIC LINK

To create a symbolic/soft link, use the syntax below:

Hopefully, after reading this, you were able to gain a better understanding of what symbolic and hard links do on a Linux system. Remember, the more you understand the basics, the easier it will be to utilize the full potential of the Shell! Also remember to be safe, know when you’re operating as root, and have fun! Until next time!

Full-Stack Software Engineering Student at Holberton School