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.

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.

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

Read Some More Articles

2 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.