1LSLOCKS(8) System Administration LSLOCKS(8)
2
3
4
6 lslocks - list local system locks
7
9 lslocks [options]
10
12 lslocks lists information about all the currently held file locks in a
13 Linux system.
14
15 Note that lslocks also lists OFD (Open File Description) locks, these
16 locks are not associated with any process (PID is -1). OFD locks are
17 associated with the open file description on which they are acquired.
18 This lock type is available since Linux 3.15, see fcntl(2) for more
19 details.
20
22 -b, --bytes
23 Print the SIZE column in bytes rather than in a human-readable
24 format.
25
26 -i, --noinaccessible
27 Ignore lock files which are inaccessible for the current user.
28
29 -J, --json
30 Use JSON output format.
31
32 -n, --noheadings
33 Do not print a header line.
34
35 -o, --output list
36 Specify which output columns to print. Use --help to get a list of
37 all supported columns.
38
39 The default list of columns may be extended if list is specified in
40 the format +list (e.g., lslocks -o +BLOCKER).
41
42 --output-all
43 Output all available columns.
44
45 -p, --pid pid
46 Display only the locks held by the process with this pid.
47
48 -r, --raw
49 Use the raw output format.
50
51 -u, --notruncate
52 Do not truncate text in columns.
53
54 -V, --version
55 Display version information and exit.
56
57 -h, --help
58 Display help text and exit.
59
61 COMMAND
62 The command name of the process holding the lock.
63
64 PID
65 The process ID of the process which holds the lock or -1 for
66 OFDLCK.
67
68 TYPE
69 The type of lock; can be FLOCK (created with flock(2)), POSIX
70 (created with fcntl(2) and lockf(3)) or OFDLCK (created with
71 fcntl(2)).
72
73 SIZE
74 Size of the locked file.
75
76 MODE
77 The lock’s access permissions (read, write). If the process is
78 blocked and waiting for the lock, then the mode is postfixed with
79 an '*' (asterisk).
80
81 M
82 Whether the lock is mandatory; 0 means no (meaning the lock is only
83 advisory), 1 means yes. (See fcntl(2).)
84
85 START
86 Relative byte offset of the lock.
87
88 END
89 Ending offset of the lock.
90
91 PATH
92 Full path of the lock. If none is found, or there are no
93 permissions to read the path, it will fall back to the device’s
94 mountpoint and "..." is appended to the path. The path might be
95 truncated; use --notruncate to get the full path.
96
97 BLOCKER
98 The PID of the process which blocks the lock.
99
101 The lslocks command is meant to replace the lslk(8) command, originally
102 written by Victor A. Abell <abe@purdue.edu> and unmaintained since
103 2001.
104
106 Davidlohr Bueso <dave@gnu.org>
107
109 flock(1), fcntl(2), lockf(3)
110
112 For bug reports, use the issue tracker at
113 https://github.com/karelzak/util-linux/issues.
114
116 The lslocks command is part of the util-linux package which can be
117 downloaded from Linux Kernel Archive
118 <https://www.kernel.org/pub/linux/utils/util-linux/>.
119
120
121
122util-linux 2.37.2 2021-06-02 LSLOCKS(8)