How to Delete a Hard Link in Linux

delete

Recently I created a link with the following:

sudo ln -n originalFileLocation

How do I delete a hard link?

Best Answer

You can delete it with rm as usual: rm NameOfFile. Note that with hard links there is no distinction between "the original file" and "the link to the file": you just have two names for the same file, and deleting just one of the names will not delete the other.