Create Symbolic Link using Terminal Command

Create Symbolic Link using Terminal
Create Symbolic Link using Terminal

If you want to create a Symbolic Link using macOS or Linux terminal command you can make use of the ln command.

LN(1)            User Commands                  LN(1)

       ln - make links between files

       ln [OPTION]... [-T] TARGET LINK_NAME
       ln [OPTION]... TARGET
       ln [OPTION]... -t DIRECTORY TARGET...

In the 1st form, create a link to TARGET with the name LINK_NAME.  
In the 2nd form, create a link to TARGET in the current directory.  
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.  
Create hard links by default,  symbolic links with --symbolic.  
By default, each destination (name of new link) should not already exist.  
When creating hard links, each TARGET must exist.  
Symbolic links can hold arbitrary text;  if later resolved, 
a relative link is interpreted in relation to its parent directory.

Syntax: ln -s source-path destination-path

ln -s /usr/bin/ /mnt/d/Users/c2c/Desktop/

Recent Posts:

Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.