From owner-freebsd-questions Mon May 12 04:08:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id EAA12694 for questions-outgoing; Mon, 12 May 1997 04:08:07 -0700 (PDT) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA12609 for ; Mon, 12 May 1997 04:07:44 -0700 (PDT) Received: by mail.EUnet.hu, id NAA03014; Mon, 12 May 1997 13:07:39 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id KAA00690; Mon, 12 May 1997 10:40:37 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199705120840.KAA00690@CoDe.hu> Subject: Re: hard links To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Mon, 12 May 1997 10:40:37 +0200 (MET DST) Cc: rewt@i-Plus.net In-Reply-To: <199705120527.BAA04270@Radford.i-Plus.net> from Troy Settle at "May 12, 97 01:29:34 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > >is there any way to determine what files are > >hard links to s specific file? it's obvious > >for softlinks using "ls", but what about > >hard links? > >--------------------------------------------------------------------- > ---- > Sure, take a look at this for a short example. > > These two files are hard linked with 4 other files. How do I know? > look at the 2nd column. See the 6? Tells me that there's 6 node > thingies in use for that one file. (I forget exactly what those > things are called. nevertheless, there's 6 directory entries for > that one file.) They called the ``number of hard links'' :-) > -r-xr-x--- 6 root bin 36864 Feb 5 08:00 /usr/bin/chpass > -r-xr-x--- 6 root bin 36864 Feb 5 08:00 /usr/bin/chsh Bye, Gabor -- #!/bin/ksh Z='21N16I25C25E30, 40M30E33E25T15U!' ;IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ';set $Z;for i { [[ $i = ? ]]&&print $i&&break;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i;print -n ${i#???};[[ "$j" = ??? ]]&&print -n "${j#??} "&&j=;typeset +i i;};IFS=' 0123456789 ';set $Z;X=;for i { [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;X="$X $i";typeset +l i;};print "$X"