Operating System - HP-UX
1825766 Members
2131 Online
109687 Solutions
New Discussion

Re: How do I see a list of open Files ?

 
SOLVED
Go to solution
Joseph Scagluso
Occasional Contributor

How do I see a list of open Files ?

I need to check if a file is open on an HP-UX 11.11 i server. Should I use 'sar' ?
6 REPLIES 6
Jeff_Traigle
Honored Contributor

Re: How do I see a list of open Files ?

Nope. You use "fuser" for that.

fuser -u file_path

This will report the PID and user that has the file open.
--
Jeff Traigle
A. Clay Stephenson
Acclaimed Contributor

Re: How do I see a list of open Files ?

The standard UNIX tool is fuser but the best tool is "lsof" -- list open files. It's one of those tools that should be on every HP-UX box.

http://gatekeep.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.75/
If it ain't broke, I can fix that.
Rick Garland
Honored Contributor

Re: How do I see a list of open Files ?

'lsof' is the tool!

Free download from http://gatekeep.cs.utah.edu
In binary depot format as well as source.
Srini Jay
Valued Contributor
Solution

Re: How do I see a list of open Files ?

If you are looking at a particular process, do "lsof -p process_id" to list the files opened by that process.

This displays all files - including the sockets open, etc.
Joseph Scagluso
Occasional Contributor

Re: How do I see a list of open Files ?

Thanks, Guys...
Joseph Scagluso
Occasional Contributor

Re: How do I see a list of open Files ?

If you are looking at a particular process, do "lsof -p process_id" to list the files opened by that process.

This displays all files - including the sockets open, etc.