Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Aug 2002 00:23:44 +0200 (MEST)
From:      Michael Grant <mg-fbsd3@grant.org>
To:        Erik Greenwald <erik@smluc.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: find by inode
Message-ID:  <200208112223.g7BMNiW00289@splat.grant.org>

next in thread | raw e-mail | index | archive | help
> > For every given inode, I want to know what the filename(s) are.
> > Unfortunatly, ls doesn't provide this info.
> 
> sure it does... with the -i for inode flag
> 
> ls -i | sort -n

No, it does not.  ls -i gives you the files in that directory and
lists their inode numbers.

It does NOT give you file names are hard linked to any individual inode.

The sort -n only puts the inode numbers in order within that
directory.  Two linked files could be anywhere on the partition, you'd 
have to do an ls -Ri from the top of the partition and sort
everything, that's exactly what I want to avoid.

Unfortunatly, it seems that Erik Trulsson is correct, there is no way
to do what I want efficiently.  The dir struct points to the inodes
and inodes do not point to file names.

Oh well, thanks for the responses.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208112223.g7BMNiW00289>