Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] file of an inode

On Thu, 28 Sep 2000, Kevin Pulo wrote:

> Simple question:  How do I find out which file is using a given inode?

Damn, I knew I should have grepped my SLUG archive first.  :(

Sorry about that.

Date: Mon, 1 Jun 1998 15:32:51 +1000 (EST)
From: Charlie Brady <cbrady@xxxxxxxxxxxxxxxx>
To: ndaglis <ndaglis@xxxxxxxxxxx>
cc: slug@xxxxxxxxxxx
Subject: Re: [SLUG] inode -> filename mapping.

On Mon, 1 Jun 1998, ndaglis wrote:

> looking in the /proc directory I can get some info which
> refers to files on disk by the inode number. How do I work
> out the name of the corresponding file?

You'll need not just an inode number, but a device.major/device.minor/inode

Assuming you can work out the right device and where it is mounted, you
can use find:

find . -inum n -print

Bye 4 now,

| Kevin Pulo                Quidquid latine dictum sit, altum viditur. |
| kev@xxxxxxxxxx                _ll l_ng__g_e_ _r_ hi__ly p__d_ct__le. |
| http://www.zip.com.au/~kev/         God casts the die, not the dice. |
`--------------- Linux: The choice of a GNU generation. ---------------'