1LSLOCKS(8)                   System Administration                  LSLOCKS(8)
2
3
4

NAME

6       lslocks - list local system locks
7

SYNOPSIS

9       lslocks [options]
10

DESCRIPTION

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

OPTIONS

22       -b, --bytes
23           Print the sizes in bytes rather than in a human-readable format.
24
25           By default, the unit, sizes are expressed in, is byte, and unit
26           prefixes are in power of 2^10 (1024). Abbreviations of symbols are
27           exhibited truncated in order to reach a better readability, by
28           exhibiting alone the first letter of them; examples: "1 KiB" and "1
29           MiB" are respectively exhibited as "1 K" and "1 M", then omitting
30           on purpose the mention "iB", which is part of these abbreviations.
31
32       -i, --noinaccessible
33           Ignore lock files which are inaccessible for the current user.
34
35       -J, --json
36           Use JSON output format.
37
38       -n, --noheadings
39           Do not print a header line.
40
41       -o, --output list
42           Specify which output columns to print. Use --help to get a list of
43           all supported columns.
44
45           The default list of columns may be extended if list is specified in
46           the format +list (e.g., lslocks -o +BLOCKER).
47
48       --output-all
49           Output all available columns.
50
51       -p, --pid pid
52           Display only the locks held by the process with this pid.
53
54       -r, --raw
55           Use the raw output format.
56
57       -u, --notruncate
58           Do not truncate text in columns.
59
60       -h, --help
61           Display help text and exit.
62
63       -V, --version
64           Print version and exit.
65

OUTPUT

67       COMMAND
68           The command name of the process holding the lock.
69
70       PID
71           The process ID of the process which holds the lock or -1 for
72           OFDLCK.
73
74       TYPE
75           The type of lock; can be FLOCK (created with flock(2)), POSIX
76           (created with fcntl(2) and lockf(3)) or OFDLCK (created with
77           fcntl(2)).
78
79       SIZE
80           Size of the locked file.
81
82       MODE
83           The lock’s access permissions (read, write). If the process is
84           blocked and waiting for the lock, then the mode is postfixed with
85           an '*' (asterisk).
86
87       M
88           Whether the lock is mandatory; 0 means no (meaning the lock is only
89           advisory), 1 means yes. (See fcntl(2).)
90
91       START
92           Relative byte offset of the lock.
93
94       END
95           Ending offset of the lock.
96
97       PATH
98           Full path of the lock. If none is found, or there are no
99           permissions to read the path, it will fall back to the device’s
100           mountpoint and "..." is appended to the path. The path might be
101           truncated; use --notruncate to get the full path.
102
103       BLOCKER
104           The PID of the process which blocks the lock.
105

NOTES

107       The lslocks command is meant to replace the lslk(8) command, originally
108       written by Victor A. Abell <abe@purdue.edu> and unmaintained since
109       2001.
110

AUTHORS

112       Davidlohr Bueso <dave@gnu.org>
113

SEE ALSO

115       flock(1), fcntl(2), lockf(3)
116

REPORTING BUGS

118       For bug reports, use the issue tracker at
119       https://github.com/util-linux/util-linux/issues.
120

AVAILABILITY

122       The lslocks command is part of the util-linux package which can be
123       downloaded from Linux Kernel Archive
124       <https://www.kernel.org/pub/linux/utils/util-linux/>.
125
126
127
128util-linux 2.38.1                 2022-05-11                        LSLOCKS(8)
Impressum