Operating System - HP-UX
1832998 Members
2298 Online
110048 Solutions
New Discussion

Check which process call a file

 
SOLVED
Go to solution
huongbuixuan
Advisor

Check which process call a file

Hi all
How can I determine which process call a file ( it is share library)?. when I used fuser command, it is only list user used this file, not process.

Thank
Viet Nam
5 REPLIES 5
T G Manikandan
Honored Contributor
Solution

Re: Check which process call a file

you can use

fuser -u

check for the u option of fuser.

If this is not helpful,then you should use the lsof utility.

grab the lsof for 64 bit from here

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/

32 bit is here
http://hpux.connect.org.uk


Thanks
Michael Tully
Honored Contributor

Re: Check which process call a file

Hi,

Unfortunately 'fuser' is not very good. As suggested, get hold of the 'lsof' tool. Below are some example on it's usage.

To which files are open for a given process id (pid)

# lsof -p

To see all the open files associated with a particular command.

# lsof -c midaemon

User name.

# lsof -u
# lsof -u

processes being used via a socket.

# lsof -i tcp:23
# lsof -i udp:123

HTH
Michael

Anyone for a Mutiny ?
harry d brown jr
Honored Contributor

Re: Check which process call a file


fuser is a childs toy compared to

lsof

live free or die
harry
Live Free or Die
Michael Tully
Honored Contributor

Re: Check which process call a file


Here's some other links to where you can get 'lsof'.

64 bit
http://www.wiretapped.net/security/host-security/lsof/binaries/hpux/B.11.11/

32 bit
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/





Anyone for a Mutiny ?
huongbuixuan
Advisor

Re: Check which process call a file

Thank for all your reply. It is very helpful.
Viet Nam