I find myself wondering why would one use a soft-link instead of a hard-link in the Linux/ UFS - could it be that soft-links conserve the resources necessary to create an extra inode and thus are a relic of the very early Unix days?

I know a soft-link points to the inode created for that file when the file was created, that a soft-link 'breaks' if the one erases the filename/inode, that a hard-link uses a new/different filename/inode pair for that file data, and that erasing one filename/inode pair of a file that has a hard-link leaves the other filename/inode (and thus its data) intact and accessible but I don't have much of a feel for why one would use a hard-link over a soft-link (or visa-versa).

Each directory on a normal Linux filesystem has at least 2 hard links: its name and its `.' entry. Additionally, its subdirectories (if any) each have a `..' entry hard linked to that directory. It wouldn't make much sense to do that with symbolic links. There are probably more hard links at system level, but yes us users generally create symbolic links as we want a shortcut to a file or folder.

xenopeek wrote:Each directory on a normal Linux filesystem has at least 2 hard links: its name and its `.' entry. Additionally, its subdirectories (if any) each have a `..' entry hard linked to that directory. It wouldn't make much sense to do that with symbolic links. There are probably more hard links at system level, but yes us users generally create symbolic links as we want a shortcut to a file or folder.

Ah ha! Now I have more detail of what I know I don't understand! Good.

Naturally the question of "Why wouldn't it make much sense to use soft-links to link to '.' and '..' wants to be asked, but I'm not going to ask it (just yet?); I'll see if I can find out through a better understanding of the file system.