Links in Linux

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Links in Linux

Postby AlanWalker on Fri May 16, 2014 4:46 pm

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
User avatar
AlanWalker
Level 4
Level 4
 
Posts: 223
Joined: Wed Jun 12, 2013 7:44 pm
Location: New York

Linux Mint is funded by ads and donations.
 

Re: Links in Linux

Postby xenopeek on Fri May 16, 2014 5:24 pm

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
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14801
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Links in Linux

Postby AlanWalker on Fri May 16, 2014 6:25 pm

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
AlanWalker
Level 4
Level 4
 
Posts: 223
Joined: Wed Jun 12, 2013 7:44 pm
Location: New York

Re: Links in Linux

Postby xenopeek on Sat May 17, 2014 3:35 am

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.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14801
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Links in Linux

Postby AlanWalker on Sat May 17, 2014 8:01 pm

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,
User avatar
AlanWalker
Level 4
Level 4
 
Posts: 223
Joined: Wed Jun 12, 2013 7:44 pm
Location: New York

Re: Links in Linux

Postby AlanWalker on Sat May 17, 2014 8:40 pm

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.
User avatar
AlanWalker
Level 4
Level 4
 
Posts: 223
Joined: Wed Jun 12, 2013 7:44 pm
Location: New York

Re: Links in Linux

Postby Crewp on Wed May 21, 2014 1:05 pm

Your avatar is making me cross eyed. Oops, I'm already cross eyed. :lol:
Image
User avatar
Crewp
Level 5
Level 5
 
Posts: 697
Joined: Sat Dec 01, 2012 8:36 pm
Location: Connecticut

Linux Mint is funded by ads and donations.
 

Return to Other Topics

Who is online

Users browsing this forum: No registered users and 1 guest