[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to create a link of another directory in home directory ...2



On Sat, Apr 27, 2002 at 07:32:15PM -0700, faisal gillani wrote:
> 
>  what is the diffrence between a symbolic & a hard link ? 

A symbolic link is basically a pointer to the real file.  If you
remove the real file, the symbolic link is broken.  A hard link
is essentially the same as a "real" file in the sense that it
creates another name for the data and the reference count for the
data goes up.  If you delete the original file name, the data will
still exist and the "hard link" will still resolve to the data.

Maybe a diagram:

   <somefile> ---> <data: refcount = 1>

   <symlink> ---> <somefile> ---> <data: refcount = 1>

   <somefile> --
                |--> <data: refcount = 2>
   <hardlink> --

There are some different rules about the two.  Hard links can't
be made to directories (generally) and can't cross filesystem 
boundaries.

Some might argue that hard links are a bad thing and should be
avoided.

-- 
Eric G. Miller <egm2@jps.net>


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: