Unix Technical Forum

find a filename by it's inode number

This is a discussion on find a filename by it's inode number within the Sco Unix forums, part of the Unix Operating Systems category; --> lslk outputs inode numbers for file locks. Is there a faster way than this find command to find out ...


Go Back   Unix Technical Forum > Unix Operating Systems > Sco Unix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-15-2008, 12:43 PM
Brian K. White
 
Posts: n/a
Default find a filename by it's inode number

lslk outputs inode numbers for file locks.

Is there a faster way than this find command to find out the filename
associated with the inode numbers?
In the following session, lslk returns immediately, but find takes 20
seconds or so before in prints that filename, and then continues to
run for an unknown time longer scanning the rest of the disk(s). (I
hit delete after another 30 seconds)

# lslk |grep 177094
rclerk 3972 1,43 177094 1280448 w 0 1022596 0 0 1022599
/dev/u (/u)
dclerk 8704 1,43 177094 1280448 w 0 1013704 0 0 1013707
/dev/u (/u)
dclerk 12712 1,43 177094 1280448 w 0 422386 0 0 422389
/dev/u (/u)
dclerk 22161 1,43 177094 1280448 w 0 391264 0 0 391267
/dev/u (/u)
dclerk 23056 1,43 177094 1280448 w 0 822526 0 0 822529
/dev/u (/u)
dclerk 24197 1,43 177094 1280448 w 0 57814 0 0 57817
/dev/u (/u)
dclerk 26499 1,43 177094 1280448 w 0 791404 0 0 791407
/dev/u (/u)
rclerk 27410 1,43 177094 1280448 w 0 1240450 0 0 1240453
/dev/u (/u)
# find / -inum 177094 -print
/u/appl/filepro/3disp/keygi
#

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 12:43 PM
Jean-Pierre Radley
 
Posts: n/a
Default Re: find a filename by it's inode number

Brian K. White typed (on Mon, Jan 12, 2004 at 01:47:24PM -0800):
| lslk outputs inode numbers for file locks.
|
| Is there a faster way than this find command to find out the filename
| associated with the inode numbers?
| In the following session, lslk returns immediately, but find takes 20
| seconds or so before in prints that filename, and then continues to
| run for an unknown time longer scanning the rest of the disk(s). (I
| hit delete after another 30 seconds)
|
| # lslk |grep 177094
| rclerk 3972 1,43 177094 1280448 w 0 1022596 0 0 1022599
| /dev/u (/u)
| dclerk 8704 1,43 177094 1280448 w 0 1013704 0 0 1013707
| /dev/u (/u)
| dclerk 12712 1,43 177094 1280448 w 0 422386 0 0 422389
| /dev/u (/u)
| dclerk 22161 1,43 177094 1280448 w 0 391264 0 0 391267
| /dev/u (/u)
| dclerk 23056 1,43 177094 1280448 w 0 822526 0 0 822529
| /dev/u (/u)
| dclerk 24197 1,43 177094 1280448 w 0 57814 0 0 57817
| /dev/u (/u)
| dclerk 26499 1,43 177094 1280448 w 0 791404 0 0 791407
| /dev/u (/u)
| rclerk 27410 1,43 177094 1280448 w 0 1240450 0 0 1240453
| /dev/u (/u)
| # find / -inum 177094 -print
| /u/appl/filepro/3disp/keygi

'find' would have returned sooner if you had an inkling to search just one
filesystem (/u) instead of all of them (/).

BTW: '-print' has been totally unecessary for the find command for
many years -- it's the default action.

--
JP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 12:43 PM
Larry Rosenman
 
Posts: n/a
Default Re: find a filename by it's inode number

In article <20040112230102.GM18439@jpradley.jpr.com>,
Jean-Pierre Radley <jpr@jpr.com> wrote:
>Brian K. White typed (on Mon, Jan 12, 2004 at 01:47:24PM -0800):
>| lslk outputs inode numbers for file locks.
>|
>| Is there a faster way than this find command to find out the filename
>| associated with the inode numbers?
>| In the following session, lslk returns immediately, but find takes 20
>| seconds or so before in prints that filename, and then continues to
>| run for an unknown time longer scanning the rest of the disk(s). (I
>| hit delete after another 30 seconds)
>|
>| # lslk |grep 177094
>| rclerk 3972 1,43 177094 1280448 w 0 1022596 0 0 1022599
>| /dev/u (/u)
>| dclerk 8704 1,43 177094 1280448 w 0 1013704 0 0 1013707
>| /dev/u (/u)
>| dclerk 12712 1,43 177094 1280448 w 0 422386 0 0 422389
>| /dev/u (/u)
>| dclerk 22161 1,43 177094 1280448 w 0 391264 0 0 391267
>| /dev/u (/u)
>| dclerk 23056 1,43 177094 1280448 w 0 822526 0 0 822529
>| /dev/u (/u)
>| dclerk 24197 1,43 177094 1280448 w 0 57814 0 0 57817
>| /dev/u (/u)
>| dclerk 26499 1,43 177094 1280448 w 0 791404 0 0 791407
>| /dev/u (/u)
>| rclerk 27410 1,43 177094 1280448 w 0 1240450 0 0 1240453
>| /dev/u (/u)
>| # find / -inum 177094 -print
>| /u/appl/filepro/3disp/keygi
>
>'find' would have returned sooner if you had an inkling to search just one
>filesystem (/u) instead of all of them (/).
>
>BTW: '-print' has been totally unecessary for the find command for
>many years -- it's the default action.

Isn't this what ncheck is for?

LER

>
>--
>JP



--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 12:43 PM
Bob Meyers
 
Posts: n/a
Default Re: find a filename by it's inode number


"Jean-Pierre Radley" <jpr@jpr.com> wrote in message
news:20040112230102.GM18439@jpradley.jpr.com...
> Brian K. White typed (on Mon, Jan 12, 2004 at 01:47:24PM -0800):
> | # find / -inum 177094 -print
> | /u/appl/filepro/3disp/keygi
>
> 'find' would have returned sooner if you had an inkling to search just one
> filesystem (/u) instead of all of them (/).
>
> BTW: '-print' has been totally unecessary for the find command for
> many years -- it's the default action.


Just think of all those times I must have typed, typo'd and corrected that
darn old "-print". I can remember, maybe from Xenix days, when I forgot it
and got no results.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-15-2008, 12:43 PM
Brian K. White
 
Posts: n/a
Default Re: find a filename by it's inode number

Jean-Pierre Radley <jpr@jpr.com> wrote in message news:<20040112230102.GM18439@jpradley.jpr.com>...
> Brian K. White typed (on Mon, Jan 12, 2004 at 01:47:24PM -0800):
> | lslk outputs inode numbers for file locks.
> |
> | Is there a faster way than this find command to find out the filename
> | associated with the inode numbers?
> | In the following session, lslk returns immediately, but find takes 20
> | seconds or so before in prints that filename, and then continues to
> | run for an unknown time longer scanning the rest of the disk(s). (I
> | hit delete after another 30 seconds)
> |
> | # lslk |grep 177094
> | rclerk 3972 1,43 177094 1280448 w 0 1022596 0 0 1022599
> | /dev/u (/u)
> | dclerk 8704 1,43 177094 1280448 w 0 1013704 0 0 1013707
> | /dev/u (/u)
> | dclerk 12712 1,43 177094 1280448 w 0 422386 0 0 422389
> | /dev/u (/u)
> | dclerk 22161 1,43 177094 1280448 w 0 391264 0 0 391267
> | /dev/u (/u)
> | dclerk 23056 1,43 177094 1280448 w 0 822526 0 0 822529
> | /dev/u (/u)
> | dclerk 24197 1,43 177094 1280448 w 0 57814 0 0 57817
> | /dev/u (/u)
> | dclerk 26499 1,43 177094 1280448 w 0 791404 0 0 791407
> | /dev/u (/u)
> | rclerk 27410 1,43 177094 1280448 w 0 1240450 0 0 1240453
> | /dev/u (/u)
> | # find / -inum 177094 -print
> | /u/appl/filepro/3disp/keygi
>
> 'find' would have returned sooner if you had an inkling to search just one
> filesystem (/u) instead of all of them (/).


well, true, and lslk's output did provide that much info, but /u is
often a lot larger than ("/" - "/u")

> BTW: '-print' has been totally unecessary for the find command for
> many years -- it's the default action.


just proves I learned on xenix like a real man unlike all these linux
weenies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-15-2008, 12:43 PM
Dan Skinner
 
Posts: n/a
Default Re: find a filename by it's inode number

brian@aljex.com (Brian K. White) wrote in message news:<60bd4c6b.0401130407.1015c50e@posting.google. com>...
> Jean-Pierre Radley <jpr@jpr.com> wrote in message news:<20040112230102.GM18439@jpradley.jpr.com>...
> > Brian K. White typed (on Mon, Jan 12, 2004 at 01:47:24PM -0800):
> > | lslk outputs inode numbers for file locks.
> > |

<snip>
> > BTW: '-print' has been totally unecessary for the find command for
> > many years -- it's the default action.

>
> just proves I learned on xenix like a real man unlike all these linux
> weenies


SCO 3.2v4.2 -print is required.
SCO 3.2v5.0.4 -print is NOT required.

However saying -print is totally unnecessary is saying my fingers automatically
know what flavor or version they are typing on. They have enough trouble
with "/" and "\".
-print may be unnecessary to later versions of SCO and to Linux, but new
rules for my old dogs (make that fingers) is asking a lot.

Regards...Dan.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-15-2008, 12:43 PM
Tony Lawrence
 
Posts: n/a
Default Re: find a filename by it's inode number

Dan Skinner <JDanSkinner@jdanskinner.com> wrote:
>brian@aljex.com (Brian K. White) wrote in message news:<60bd4c6b.0401130407.1015c50e@posting.google. com>...
>> Jean-Pierre Radley <jpr@jpr.com> wrote in message news:<20040112230102.GM18439@jpradley.jpr.com>...
>> > Brian K. White typed (on Mon, Jan 12, 2004 at 01:47:24PM -0800):
>> > | lslk outputs inode numbers for file locks.
>> > |

><snip>
>> > BTW: '-print' has been totally unecessary for the find command for
>> > many years -- it's the default action.

>>
>> just proves I learned on xenix like a real man unlike all these linux
>> weenies


>SCO 3.2v4.2 -print is required.
>SCO 3.2v5.0.4 -print is NOT required.


>However saying -print is totally unnecessary is saying my fingers automatically
>know what flavor or version they are typing on. They have enough trouble
>with "/" and "\".
>-print may be unnecessary to later versions of SCO and to Linux, but new
>rules for my old dogs (make that fingers) is asking a lot.


I'm sure JPR knows this, but let me also point out that saying
print is not necessary doesn't really tell the whole story. It
is not needed for the simple cases here, but it becomes very necessary
in more complex usage.

--
tony@aplawrence.com Unix/Linux/Mac OS X resources: http://aplawrence.com
Get paid for writing about tech: http://aplawrence.com/publish.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com