Summary
In this post we will learn safest method to remove softlink in Linux. Softlink is also known as symbolic link which is special type of file provide the reference of file or directory with its absolute path.
When you run the command ls -la <filename> OR ls -la <DirectoryName>
in output you may observe l letter as prefix in permission mode field. This represent the Softlink.
Command Line To Remove Softlink Of File
In the given below command, replace the value of softLink-FileName to actual File Name. This will remove / unlink the Softfile.
unlink <softLink-FileName>
Example with screenshot
In the given below example (check the screenshot), we created a new softlink called yes.txt and later we have removed it by using unlink command.
Conclusion
In some tutorial you may also find the rm
command to remove softlink but rm
command is also used for removing file or directory.
So here the person can do reading mistake like without checking about the file or directory is softlink or symbolic link.. The person may remove file/directory. To avoid such kind of accidental human reading mistake it is recommended to use unlink
command for removing softlink
Great Tutorial. It work for me.
Thanks
Happy to hear,
Thankyou Imran for providing feedback.
Regards
Sharad