cancel
Showing results for 
Search instead for 
Did you mean: 

lsof

 
SOLVED
Go to solution
Highlighted
Super Advisor

lsof

Dear Sirs,

Can someone suggest how to use lsof command and interpret its output on hpux 11i ?

Thanks,
Shiv
7 REPLIES 7
Highlighted
Esteemed Contributor

Re: lsof

Have a look at this:

http://www.annodex.net/cgi-bin/man/man2html?lsof+8
Vibhor Kumar Agarwal
Highlighted
Honored Contributor

Re: lsof

lsof=list open files
as you may already know, everything is treated as files on unix OS. So, you can lisy pretty much anything that is open by lsof.

if you want to see files kept open by a process, you run it as

lsof |grep $PID

if you want to see who is keeping a port open

lsof -i tcp | grep $PORTNUM

The answer basically is : It Depends !

See this page for the man pages if you do not have them on your computer:

http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.75/man.html

man pages explains in quite detail how best to use the product
________________________________
UNIX because I majored in cryptology...
Highlighted
Esteemed Contributor

Re: lsof

Shiv,
you can check this one out

http://www.akadia.com/services/lsof_intro.html

thanks
DP
Highlighted
Honored Contributor

Re: lsof

hi shiv,

try "lsof -h" or "lsof -?" as well. the 4th line of the output will direct u to a man page as well.

regards.
what you do not see does not mean you should not believe
Highlighted
Honored Contributor

Re: lsof

Hi Shiv

lsof in hp-ux11i is used for

List files, sockets, etc opened by processes

Regards
Mahesh
Highlighted
Super Advisor

Re: lsof

Dear Sirs;

Thanks a lot to show how to use the lsof.

But i need to figure out how to decide the number of open files or sockets are more than the critical point and there exist a problem ?

Thanks and regards,
Shiv
Highlighted
Honored Contributor
Solution

Re: lsof

hi shiv,

you can check this in Glance+.

for instance, run glance and type t for "System Tables"

there you will be able to find current values of the following variables (displayed in terms of "Available, Used, Utilisation, High(%)":
System Table
--------------------------
Proc Table (nproc)
File Table (nfile)
Shared Mem Table (shmmni)
Message Table (msgmni)
Semaphore Table (semmni)
File Locks (nflocks)
Pseudo Terminals (npty)
Buffer Headers (nbuf)
Inode Cache (ninode)
Shared Memory
Message Buffers
Buffer Cache
Buffer Cache Min
Buffer Cache Max
DNLC Cache


however, lsof is more powerful in querying. see man lsof for all available options.

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)