hard links

Lonni J Friedman netllama at gmail.com
Sat Oct 27 21:41:06 PDT 2007


On 10/27/07, David A. Bandel <david.bandel at gmail.com> wrote:
> On 10/27/07, Collins Richey <crichey at gmail.com> wrote:
> > Thought for the weekend.
> >
> > What is the purpose of a hard link, and does anything in Linux land
> > use hard links?
>
> I'll answer your question in reverse order:
> lots of stuff uses it.  look through /bin and /sbin using:
> ls -ali | sort
> here's my output:
> david at tole:/bin$ ls -ali | sort | uniq -D -w 7
> 2572294 -rwxr-xr-x  3 root root   25140 May 21 00:44 bunzip2
> 2572294 -rwxr-xr-x  3 root root   25140 May 21 00:44 bzcat
> 2572294 -rwxr-xr-x  3 root root   25140 May 21 00:44 bzip2
> 2572296 -rwxr-xr-x  2 root root    2105 May 21 00:43 bzcmp
> 2572296 -rwxr-xr-x  2 root root    2105 May 21 00:43 bzdiff
> 2572297 -rwxr-xr-x  3 root root    3642 May 21 00:43 bzegrep
> 2572297 -rwxr-xr-x  3 root root    3642 May 21 00:43 bzfgrep
> 2572297 -rwxr-xr-x  3 root root    3642 May 21 00:43 bzgrep
> 2572300 -rwxr-xr-x  2 root root    1297 May 21 00:43 bzless
> 2572300 -rwxr-xr-x  2 root root    1297 May 21 00:43 bzmore
> 2588739 -rwxr-xr-x  2 root root      61 Aug 18 21:49 gunzip
> 2588739 -rwxr-xr-x  2 root root      61 Aug 18 21:49 uncompress
>
> So for example, when you call bunzip2 or bzip2, you're calling the
> same binary, just with a different name.   This is like calling the
> binary with different options, but easier to remember.
>
> Take a look at `man bzip2` to see what I mean.

Redhat uses a softlink (symlink).

>
> ifup/ifdown on my system is the same as are many of the fsck binaries.

ifup & ifdown are completely separate shell scripts on Redhat.



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                                    netllama at gmail.com
LlamaLand                       https://netllama.linux-sxs.org



More information about the Linux-users mailing list