Operating System - HP-UX
1832085 Members
3039 Online
110037 Solutions
New Discussion

Process id's of programs which opens a file.

 
Amith_2
Frequent Advisor

Process id's of programs which opens a file.

Hello,

I would like to know whether there is any command or method to find out which all processes are opening a recovery file.

All my programs access a recovery file while posting transactions , i would like to know the process id of the process which has opened the file and has written details into it.

Can any one help me out in this
3 REPLIES 3
Yang Qin_1
Honored Contributor

Re: Process id's of programs which opens a file.

Hi, try with fuser

fuser -u /path/file

Yang
Peter Godron
Honored Contributor

Re: Process id's of programs which opens a file.

Hi,
you can download lsof from:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.77/

# lsof /home/godronpw/usage.c
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
f.sh 29050 godronpw 0u REG 64,0x5 367 75 /home/godronpw/usage.c
sleep 29062 godronpw 0u REG 64,0x5 367 75 /home/godronpw/usage.c

lsof can also be used for port usage etc.
siva0123
Trusted Contributor

Re: Process id's of programs which opens a file.

Hi ,

lsof is better.

Try it


Thanks,
Siva