How Do I Remove a Hard Link in Linux?
Contents 4 Answers. 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...
4 Answers. 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.
What happens if I delete a hard link?
If you delete the ‘my-hard-link’ of a hard link, the remaining files pointing to that same space (inode) in the hard drive will still contain the data stored on the hard drive.
Must Read
How do I change a hard link in Linux?
Use the ln command to create additional hard links to an existing file (but not to a directory, even though the system sets up . and .. as hard links). Listing 1 shows how to create a directory containing two files and a subdirectory with two hard links to file1, one in the same directory and one in the subdirectory.