Linux Command To Create Link

Chapter: Linux Commands Last Updated: 15-11-2019 09:06:51 UTC

Program:

            /* ............... START ............... */
                

ubuntu@ubuntu:~/Desktop$ ln -s ~/test.sh LinkName    // Command will create a new link to file ~/test.sh

ubuntu@ubuntu:~/Desktop$ ln -sf ~/test.sh LinkName  // -sf parameter is used to update the existing link.


ubuntu@ubuntu:~/Desktop$ ls -lrt LinkName    // ls -lrt will give the details of link (Link location)
lrwxrwxrwx 1 ubuntu ubuntu 20 Nov 15 00:58 LinkName -> /home/ubuntu/test.sh

                /* ............... END ............... */
        

Output


            Linux Command To Create Link
        

Notes:

  • Command used to make symbolic link in Linux is "ln".
  • Syntax : ln [OPTION]... [-T] TARGET LINK_NAME
  • Linux command to create a new link : ln -s filelocation linkName
  • ln is link command, -s is parameter to create new link, filelocation mentions the file location and linkName is the name of the symbolic link.
  • Commmand to update the existing link in Linux using command line : ln -sf filelocation linkName
  • To update the existing link you have to use -sf, it will update the link with the new filelocation.
  • ls -lrt linkName will give the details of the link and location to which it is linking. (LinkName -> /home/ubuntu/Downloads/test.sh).
  • For more information you can refer the program section and output for more clarification regarding this.

Tags

linux create symbolic link directory, links command in linux, How to update existing link in linux.

Similar Programs Chapter Last Updated
How To Enable Permission On File Linux Ubuntu Linux Commands 26-08-2023
Linux Command To Give All Permissions To A File Linux Commands 24-08-2023
Important Network Commands In Linux Linux Commands 24-08-2023
Important Commands In Linux Linux Commands 24-08-2023
Grep Command In Linux Example Linux Commands 10-05-2023
Traceroute Command In Ubuntu Linux Commands 10-05-2023
Linux Command To Count Number Of Files In A Directory Linux Commands 18-03-2023
Linux Version Command Linux Commands 01-12-2020
Unzip Command In Linux Linux Commands 20-11-2019
Process Command In Linux Linux Commands 16-11-2019
Linux Command To View File Content Linux Commands 25-10-2019
Linux Command To Check OS Version Linux Commands 25-10-2019
Netstat Command In Linux Linux Commands 13-08-2019
Telnet Command In Linux Linux Commands 13-08-2019
Linux Command To Create A File Linux Commands 23-05-2019
Linux echo Command Linux Commands 05-05-2018
Linux Ping Command Linux Commands 05-05-2018
Linux ls (List Directory) Command Linux Commands 17-03-2018

1