If you do rm myFile where myFile is a hard link, what happens?
|
|
|
In Unix all normal files are Hardlinks. Hardlinks in a Unix (and most (all?) ) filesystems are references to an to what's called an In short, as long as you do not delete the last link the file will remain.
This IMHO is by far the easiest way to understand hard-links (and its difference from softlinks). |
|||||||||||||||
|
|
Testing was easier than I thought: I created a text file, then hard linked to it. Deleting the hard link does not delete the file it is hardlinked to and the file that was linked to remains where it is. |
|||||
|
|
You delete the hard link and the file hardlinked with it. |
|||||
|