Soft links just point to some other file or directory in the file system of Ubuntu with the same name and path, whereas hard links are created with some new names, just like copies of original files.
In this blog, the method of creating the symbolic links in Ubuntu will be explored by demonstrating with some simple examples.
In Ubuntu, by default, the ln utility is available, which links files/folders to some other files. The ln command utility is used to create the symbolic links by using the option of “-s”. The general syntax of using the ln command:
In the above expressions, the user is supposed to provide the two parameters, one of File whose symbolic link is to be created and the other is Link to which the file is to be linked. If the user does not provide the Link, then Ubuntu will link the file with the present directory.
For a better understanding, following the above-mentioned general syntax, the symbolic link is being created for the File “MyCFile” using the command:
List down the contents of the directory to confirm the symbolic link:
In the above command, “-l” option is used to display the link of the file.
Creating the symbolic links of the directories is similar to creating links of files. For example, we will create the symbolic link of /Home/Music to ~/my_music:
There are two ways either by deleting the symbolic link or unlink the symbolic link. To unlink the link of a file with its symbolic link, use the command:
Similarly, if you want to remove the symbolic link, then run the command:
The link has been deleted from Ubuntu.
The “ln” command utility with its option of “-s” is used to create symbolic links of files and directories in Ubuntu 22.04. In this blog, different creations of symbolic links have been explored with the help of some examples.
The Web Engineering team is thrilled to announce the successful conclusion of our third annual…
This article provides a guide for how to install Microsoft SQL Server on Ubuntu VPS.…
Here’s a step-by-step guide to deploy FlowiseAI (commonly just Flowise) on a Ubuntu VPS using…
Ubuntu images on Microsoft Azure have recently started shipping with the open source package azure-vm-utils…
Organizations everywhere are pushing AI and networks closer to the edge. With that expansion comes…
Every developer who maintains Ruby gems knows that sinking feeling when a user reports an…