Sym Files

Chuck Hallenbeck chuckh at sent.com
Tue Oct 14 18:47:45 EDT 2003


Thomas,

Many thanks. That is very helpful. I have always used symlinks
and have never run across a description of the difference I have
understood, but I think I have a handle on it as you described
it.

Chuck

On Tue, 14 Oct 2003, Thomas Stivers wrote:

> On 10/14/03  4:42 PM -0400, Chuck Hallenbeck wrote:
> > Luke,
> >
> > While you are at it, what exactly is the difference between a
> > hard link and a soft link?
>
> The difference is that a symbolic (soft) link is a special file which
> contains the name of the file it points to. Symbolic links can work
> across file systems which hard links cannot.
>
> Hard links are simply references to the same inode by another name, but
> in every way besides the name they *are* the same file. Here is a sample "ls -l" that illustrates this.
>
> total 0
> -rw-r--r--    2 thomas   thomas          0 2003-10-14 16:00 file1
> -rw-r--r--    2 thomas   thomas          0 2003-10-14 16:00 hard1
> lrwxrwxrwx    1 thomas   thomas          5 2003-10-14 16:00 sym1 -> file1
>
> In this example file1 is a regular file and hard1 is a link to it. The
> number 2 after the file permissions means that the file has two names
> linked to it and if we "rm" either file1 or hard1 that number will
> decrease to 1. A key point is that they are both references to the same
> file. The third entry sym1 is a symbolic link and is a different file
> altogether, but it contains the name of file1 and because the file
> system knows it is a link it will look for file1. I hope this doesn't
> muddy the waters too much and Luke's description is still more
> practical.
>
>

-- 
The Moon is Waning Gibbous (82% of Full)
 Get my public key from website, http://www.mhonline.net/~chuckh





More information about the Speakup mailing list