Very quickly, this is how I understand hard/soft links(ln):
- Hard links point directly to the data of some file. Having it's own attributes (rwx etc.) and is indistinguishable from the original, because it is not pointing to the original file, it is pointing to the data the original file was pointing to. In another way to describe it, the linked file is just another name for the data. If you erase the file that the linked file original linked to, the data would still be there because the file you erase was not the last file that is using the data.
Code:
Ex:
Original_File --> the_data
Hard_Linked_File links to Original_File's data.. so..
Hard_Linked_File --> the_data
- Soft links (or symbolic links, and symlinks), point directly to a file, which then that file points to the data it was assigned. Whatever attributes the original file posseses, passes it on to the other file that is soft linked to it. And unlike the hard link, if the source (or main) file is erased, the symlink file will contain no data(and will look red on some terminals).
Code:
Ex:
Original_File --> the_data
Soft_Linked_File links to the Original_File.. so..
Soft_Linked_File --> Original_File --> the_data
Am I correct? Apparently it is easier to point to file across different file systems using symlinks