Properly unlinking hard links

TL;DR... just delete the file name you don't want (with rm).

If you create a hard link (which is what your command above is doing), you have two names pointing to the same area of storage. You can delete either name without affecting the other name or the storage - it's only when the last name is removed that the area of storage is released.

Compare this to soft links... created with ln -s - there, the link is different, it's a pointer to the original name rather than a pointer to the storage. If you delete the original named file the soft links point to something that has been deleted, so the link remains but is broken.


The command to remove a hard link is rm.

From the man page for rm:

Remove (unlink) the FILE(s).

Tags:

Hard Link