How to create a Symbolic Link in Linux (ln -s)

We can create a Symbolic link in Linux Terminal using the ln (link) command with the -s option.

Let's take a look at a few examples.


ln -s <file-or-dir-path> <symbolic-link-name>

Example 1: Symbolic Link of a File

# ln -s /home/data/records_2023.csv data
Example - Creating a Symbolic Link - Linux

Example 2: Symbolic Link of a Directory

# ln -s /home/app/data/2023/records records

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap