From owner-freebsd-questions Sun Aug 11 15:27:39 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEC5837B400 for ; Sun, 11 Aug 2002 15:27:37 -0700 (PDT) Received: from grant.org (grant.org [206.190.164.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D06943E42 for ; Sun, 11 Aug 2002 15:27:37 -0700 (PDT) (envelope-from mgrant@splat.grant.org) Received: from splat.grant.org (mgrant@splat.grant.org [213.39.2.177]) by grant.org (8.12.3/8.12.3) with ESMTP id g7BMRYb4040226; Sun, 11 Aug 2002 18:27:35 -0400 (EDT) (envelope-from mgrant@splat.grant.org) Received: (from mgrant@localhost) by splat.grant.org (8.11.6+Sun/8.11.6) id g7BMNiW00289; Mon, 12 Aug 2002 00:23:44 +0200 (MEST) Date: Mon, 12 Aug 2002 00:23:44 +0200 (MEST) Message-Id: <200208112223.g7BMNiW00289@splat.grant.org> From: Michael Grant To: Erik Greenwald Cc: freebsd-questions@freebsd.org Subject: Re: find by inode Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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