The Linux Concept Journey — Link File (aka Symbolic Link)

Shlomi Boutnaru, Ph.D.
2 min read1 day ago

--

As you know there are seven different file types used in Linux (https://medium.com/@boutnaru/the-linux-concept-journey-linux-file-types-4cb622887331). Among them we have a “link” file type (aka “symbolic link’), which is used for pointing to other files (https://www.freecodecamp.org/news/linux-ln-how-to-create-a-symbolic-link-in-linux-example-bash-command/). When using “ls -l” (https://man7.org/linux/man-pages/man1/ls.1.html) link files are marked with “l” in the output — as shown in the screenshot below.

Overall, we can use the “ln” command (https://www.man7.org/linux/man-pages/man1/ln.1.html) to make links between files. It supports both creating “hard links” (https://medium.com/@boutnaru/the-linux-concept-journey-hard-link-f3e9b3d6b8c4) and “symbolic links”. In order to create a “link file” we need to use the “-s” switch — as shown in the screenshot below.

Lastly, as opposed to “hard links” that can’t be created to a directory a “symbolic link” can point to a directory — as shown in the screenshot below. By the way, “symbolic links” are also called “soft links” (https://www.geeksforgeeks.org/soft-hard-links-unixlinux/).

See you in my next writeup ;-) You can follow me on twitter — @boutnaru (https://twitter.com/boutnaru). Also, you can read my other writeups on medium — https://medium.com/@boutnaru. You can find my free eBooks at https://TheLearningJourneyEbooks.com.

--

--