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

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!