I would like to get a list of pid's which hold shared lock on /tmp/file
. Is this possible using simple command line tools?
Monitoring file locks, locked using flock
filesinotifylock
filesinotifylock
I would like to get a list of pid's which hold shared lock on /tmp/file
. Is this possible using simple command line tools?
Best Answer
From
man lsof
:FD is the File Descriptor number of the file or: FD is followed by one of these characters, describing the mode under which the file is open:
So
R
in3uR
mean that read/shared lock is issued by613
PID.Reading directly from
/proc/locks
is faster thanlsof
,