दो संभावनाएँ: lsof(मेरी प्राथमिकता) या lslk(विशेषकर फ़ाइल ताले के लिए):
[root@policyServer ~]# lslk | grep "master.lock"
SRC PID DEV INUM SZ TY M ST WH END LEN NAME
master 1650 253,0 12423 33 w 0 0 0 0 0 /var/lib/postfix/master.lock
[root@policyServer ~]# lsof | grep "master.lock"
master 1650 root 10uW REG 253,0 33 12423 /var/lib/postfix/master.lock
Lslk का आउटपुट स्व-विस्तारक है लेकिन lsofलॉक विवरण को "FD" कॉलम (जो 10uWऊपर है) में रखता है । मैन पेज से:
The mode character is followed by one of these lock characters, describing the type of lock applied to the file:
N for a Solaris NFS lock of unknown type;
r for read lock on part of the file;
R for a read lock on the entire file;
w for a write lock on part of the file;
W for a write lock on the entire file;
u for a read and write lock of any length;
U for a lock of unknown type;
x for an SCO OpenServer Xenix lock on part of the file;
X for an SCO OpenServer Xenix lock on the entire file;
space if there is no lock.
तो ऊपर का "एफडी" कॉलम lsofटूट जाता है:
10इस खुली फाइल का शाब्दिक विवरण। किस से जुड़ा हुआ है/proc/1650/fd/10
u फ़ाइल पढ़ने और लिखने के लिए खुली है
W प्रोग्राम में फाइल पर राइट लॉक है।