Links in Linux

Archived topics about LMDE 1 and LMDE 2
Locked
AlanWalker

Links in Linux

Post 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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29612
Joined: Wed Jul 06, 2011 3:58 am

Re: Links in Linux

Post 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
Image
AlanWalker

Re: Links in Linux

Post 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"
Last edited by AlanWalker on Sat May 17, 2014 8:36 pm, edited 4 times in total.
User avatar
xenopeek
Level 25
Level 25
Posts: 29612
Joined: Wed Jul 06, 2011 3:58 am

Re: Links in Linux

Post 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.
Image
AlanWalker

Re: Links in Linux

Post 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,
AlanWalker

Re: Links in Linux

Post 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.
Crewp

Re: Links in Linux

Post by Crewp »

Your avatar is making me cross eyed. Oops, I'm already cross eyed. :lol:
Locked

Return to “LMDE Archive”