Page 1 of 1

Links in Linux

Posted: Fri May 16, 2014 4:46 pm
by AlanWalker
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).

Any thoughts would be appreciated.

TIA

Re: Links in Linux

Posted: Fri May 16, 2014 5:24 pm
by xenopeek
Google is not your friend I take it :) Search for "soft links vs hard links" turns up many useful articles. This is a good one: http://www.cyberciti.biz/tips/understan ... links.html

Re: Links in Linux

Posted: Fri May 16, 2014 6:25 pm
by AlanWalker
xenopeek wrote:Google is not your friend I take it :) Search for "soft links vs hard links" turns up many useful articles. This is a good one: http://www.cyberciti.biz/tips/understan ... links.html
... occasionally, I find duckduckgo.com the better tool (snip)

Here's an example of the differences that can exist in responses between Google and Duckduckgo:

Search for "Trash/*/**" linux mint on Google then search on Duckduckgo using the same argument.

Regards,

Oops... I clicked on "Edit" instead of "Quote"

Re: Links in Linux

Posted: Sat May 17, 2014 3:35 am
by xenopeek
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.

Re: Links in Linux

Posted: Sat May 17, 2014 8:01 pm
by AlanWalker
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.

Thanks, and

Regards,

Re: Links in Linux

Posted: Sat May 17, 2014 8:40 pm
by AlanWalker
Occasionally, I find duckduckgo.com the better tool.

Here's an example of the differences that can exist in responses between Google and Duckduckgo:

Search for "Trash/*/**" linux mint on Google then search on Duckduckgo using the same argument.

It seems that Google is loosing the ability to focus.


Regards,

Note: reposted.

Re: Links in Linux

Posted: Wed May 21, 2014 1:05 pm
by Crewp
Your avatar is making me cross eyed. Oops, I'm already cross eyed. :lol: