In today’s write-up, we will be describing how to take away a symbolic connection in Linux. Note that taking away a symbolic url does not have an affect on the file it points to.
Before eradicating a file, you can verify whether it is a symbolic connection making use of the ls -l command. It will also clearly show you the file or listing that it factors to.
The l in permissions (lrwxrwxrwx) confirms that it is a symbolic backlink.
Remove a Symbolic Hyperlink applying the unlink command
The unlink command is employed for getting rid of a solitary file from the file procedure. To get rid of a symbolic link in Linux, kind the unlink command adopted by the name of the symbolic url and hit Enter:
$ sudo unlink symbolic_connection
Switch symbolic_connection with the name of the symbolic link you want to eliminate. After that, you can use the ls -l command to validate if the symlink has been eliminated.
Clear away a symlink that points to a directory, really do not use the slash soon after the directory name. Let’ say we want to remove a symbolic link directory named Docs, as shown in the next screenshot:
The command to get rid of the symlink directory will be:
Remove a Symbolic Connection using the rm command
The rm command can also be made use of to get rid of a symbolic website link. For taking away a symbolic website link in Linux, variety the rm command followed by the identify of the symbolic hyperlink and strike Enter:
Soon after that, you can use the ls -l command to confirm if the symlink has been taken off.
You can also use the -i flag with the rm command to prompt for confirmation.
Getting rid of a symlink that factors to a listing, never use the slash just after the listing name. Let’ say we want to eliminate a symbolic link listing named Docs, as proven in the following screenshot:
The command to eliminate the symlink listing will be:
After that, you can use the ls -l command to confirm if the symlink has been eliminated.
That is all there is to it! You have uncovered to take away a symbolic link in Linux OS utilizing the unlink and rm command in this write-up. Whilst getting rid of a symbolic hyperlink, make confident only to get rid of the symbolic link alone, not the file or listing it is linking to.