1846163 Members
6041 Online
110254 Solutions
New Discussion

lsof question on results

 
SOLVED
Go to solution
Larry Scheetz
Advisor

lsof question on results

Admins,

Installed and testing lsof on 11.i and not sure what all the columns stand for in the results. I can't seem to find anything on the net. Is there any quick refernce to explain what the result columns stand for?

Thx
A Happy heart makes the face cheerful
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: lsof question on results

Hi Larry:

Like any good Unix tool, the manpages should help you.

# man lsof

Regards!

..JRF...
Patrick Wallek
Honored Contributor

Re: lsof question on results

Couldn't find anything on the net? If you just type 'lsof' into google.com you'll get more that 1 million results returned.

Here's the man page for lsof from the HP Porting and Archive Centre:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.77/man.html
gstonian
Trusted Contributor
Solution

Re: lsof question on results

From the man page:


COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
swapper 0 root cwd DIR 64,0x3 8192 2 /
swapper 0 root mem REG 64,0x7 572404 25344 /usr/local/utils/bin/lsof-4.76/lsof
swapper 0 root mem REG 64,0x7 132136 43 /usr/lib/hpux32/libnss_files.so.1
swapper 0 root mem REG 64,0x7 28020 68022 /usr/lib/hpux32/libdl.so.1
swapper 0 root mem REG 64,0x6 302756 50691 /opt/star-ncf-prod/ep_patch/usr/lib/hpux32/libxti.so.1
swapper 0 root mem REG 64,0x7 4592812 12335 /usr/lib/hpux32/libc.so.1
swapper 0 root mem REG 64,0x7 1546672 14666 /usr/lib/hpux32/libnsl.so.1


Command = Command
PID = Process ID
User = User initiated command
FD = File Descriptors
TYPE is the type of the node associated with the file - e.g.,
GDIR, GREG, VDIR, VREG, etc.
SIZE/OFF is the size of the file or the file offset in bytes
Name is the name of

NAME is the name of the mount point and file system on which the
file resides;

Reshma Malusare
Trusted Contributor

Re: lsof question on results

Hi Larry,

1>IF a filesystem is showing a high capacity percentage value,then instead of fuser command to find out.Another tool you can run is lsof (third party program, public domain) to see what files are open.
2>Also,If an open file is deleted accidentally, it is possible to use lsof to recreate a copy of the file; provided this is done before the file is closed by the application holding it open.

lsof can be found at the following web site: ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
Here is a example of losf report:
lsof -a +L1 /dgate-log
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
dgsrvr 1180 dgate 32u VREG 2203,928932 2705 0 3969 /dgate-log (Spawn#malebolgia)
dgsrvr 1180 dgate 53u VREG 2203,928932 6604104 0 4012 /dgate-log (Spawn#malebolgia)

Command-->
PID --> process id that has this file open
User,FD,Type,Device,Size,Nlink,Node,Name.


Check following threads also:

http://www1.itrc.hp.com/service/james/search.do?todo=search&searchtext=lsof&from=forums&submit.x=5&origin=0&wpa=forums1.itrc.hp.com%3A80&submit.y=3&searchcategory=ALL&hpl=1&searchcriteria=allwords&rn=25&source=7000&presort=rank&chkServStor=on&esc=us.support.itrc.hp.com&admit=-682735245+1172239653941+28353475
Reshma Malusare
Trusted Contributor

Re: lsof question on results

Hi Larry,
So columns means here are
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
dgsrvr 1180 dgate 32u VREG 2203,928932 2705 0 3969 /dgate-log (Spawn#malebolgia)

PID--> Process id
User --> who is using
FD --> File Descriptor
Type --> type of node here VREG
Size --> size of the file
Node-> node number
Nlink --> no.of links
Name --> dir where mounted [mount dir]