1829166 Members
2123 Online
109986 Solutions
New Discussion

How many open files

 
James Harrington
Frequent Advisor

How many open files

Does any body know of a command I can use to find out how many open files a process has?

If not how about how many open files there are for the whole system?
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: How many open files

Hi James:

Use 'lsof' for looking at an individual process.

Use 'glance' or 'sar -v' to obtain a system-wide (global) count.

Regards!

...JRF...
Tom Danzig
Honored Contributor

Re: How many open files

For a process:
lsof -p | wc -l

Systemwide:
lsof | wc -l
- or -
sar -v (and look at file-sz)
Sridhar Bhaskarla
Honored Contributor

Re: How many open files

Hi,

lsof is for sure the best answer. Couple more methods.

How many open files on the system?... Do a

sar -v 2 20 and observe file-sz parameter. These are the file descriptors currently in use.

For the other question, if you have glance, run glance and type "F" and enter the pid of the process. It will show all the files opened by that process.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
harry d brown jr
Honored Contributor

Re: How many open files

Glance/measureware

OR

lsof:

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.64/


live free or die
harry
Live Free or Die