Finding the Link, the Hard Link

Kenneth P. Turvey kt-usenet at squeakydolphin.com
Wed Mar 15 17:59:12 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 15 Mar 2006 09:32:30 -0500, David Walker wrote:

> So I ask, is there a way to tell the difference between the real file, 
> and a hard link?

There really isn't a "real file" and a "hard link".  As far as the
filesystem is concerned both names are equally valid.  You can tell they
point to the same file information because they will have the same inode
number:

kt at volkswagon:~/demo$ touch myfile
kt at volkswagon:~/demo$ ln myfile linkedfile
kt at volkswagon:~/demo$ touch otherfile
kt at volkswagon:~/demo$ ls -il
total 0
189974 -rw-r--r--  2 kt kt 0 2006-03-15 11:57 linkedfile
189974 -rw-r--r--  2 kt kt 0 2006-03-15 11:57 myfile
190029 -rw-r--r--  1 kt kt 0 2006-03-15 11:57 otherfile

I hope this helps.

- -- 
Kenneth P. Turvey <kt-usenet at squeakydolphin.com>

XMPP  IM: kpturvey at jabber.org
Yahoo IM: kpturvey2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEGFXni2ZgbrTULjoRAsiJAJ98THg2tbUu2/pRRWD3r5+SwUM3jwCgvg4K
UjWbaPsIl12I1cqQpzkdyeU=
=LYbp
-----END PGP SIGNATURE-----






More information about the ubuntu-users mailing list