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.


Syntax:

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: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

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