1752786 Members
6219 Online
108789 Solutions
New Discussion юеВ

lsof

 
SOLVED
Go to solution
Shivkumar
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
Vibhor Kumar Agarwal
Esteemed Contributor

Re: lsof

Have a look at this:

http://www.annodex.net/cgi-bin/man/man2html?lsof+8
Vibhor Kumar Agarwal
Mel Burslan
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...
Devesh Pant_1
Esteemed Contributor

Re: lsof

Shiv,
you can check this one out

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

thanks
DP
Joseph Loo
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
Mahesh Kumar Malik
Honored Contributor

Re: lsof

Hi Shiv

lsof in hp-ux11i is used for

List files, sockets, etc opened by processes

Regards
Mahesh
Shivkumar
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
Yogeeraj_1
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)