Ad space (banner)
🖥️Linux Lessons
Lesson 28 / 61

Creating a Symbolic Link with ln -s

ln -s is for when "I want to make the same file accessible from multiple locations." ln -s creates a symbolic link — a kind of shortcut — pointing to the original file.

Use it in the form ln -s target link-name. Adding -s makes it a "symbolic link" — a reference only, with nothing actually copied.

Running ln -s notes.txt link.txt creates a symbolic link named link.txt; opening link.txt shows you the contents of notes.txt.

A common early mistake is deleting or moving the original target file, leaving the link "broken" and unable to open. Remember a link is only ever a reference.

In real work, this is used for switching between versions of a config file, or letting several projects reference a shared library.

Linux
Try it (type this into the pseudo terminal)
ln -s notes.txt link.txt

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)