]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/lslocks.8
lslocks: add info about OFD
[thirdparty/util-linux.git] / misc-utils / lslocks.8
1 .\" Man page for the lslocks command.
2 .\" Copyright 2012 Davidlohr Bueso <dave@gnu.org>
3 .\" May be distributed under the GNU General Public License
4
5 .TH LSLOCKS 8 "December 2014" "util-linux" "System Administration"
6 .SH NAME
7 lslocks \- list local system locks
8 .SH SYNOPSIS
9 .B lslocks
10 [options]
11
12 .SH DESCRIPTION
13 .B lslocks
14 lists information about all the currently held file locks in a Linux system.
15 .sp
16 Note that lslocks also lists OFD (Open File Description) locks, these locks are
17 not associated with any process (PID is -1). OFD locks are associated with the
18 open file description on which they are acquired. This lock type is available
19 since Linux 3.15, see \fBfcntl\fR(2) for more details.
20
21 .SH OPTIONS
22 .TP
23 .BR \-i , " \-\-noinaccessible"
24 Ignore lock files which are inaccessible for the current user.
25 .TP
26 .BR \-J , " \-\-json"
27 Use JSON output format.
28 .TP
29 .BR \-n , " \-\-noheadings"
30 Do not print a header line.
31 .TP
32 .BR \-o , " \-\-output " \fIlist\fP
33 Specify which output columns to print. Use
34 .B "--help"
35 to get a list of all supported columns.
36
37 The default list of columns may be extended if \fIlist\fP is
38 specified in the format \fI+list\fP (e.g. \fBlslocks -o +BLOCKER\fP).
39 .TP
40 .BR \-p , " \-\-pid " \fIpid\fP
41 Display only the locks held by the process with this \fIpid\fR.
42 .TP
43 .BR \-r , " \-\-raw"
44 Use the raw output format.
45 .TP
46 .BR \-u , " \-\-notruncate"
47 Do not truncate text in columns.
48 .TP
49 .BR \-V , " \-\-version"
50 Display version information and exit.
51 .TP
52 .BR \-h , " \-\-help"
53 Display help text and exit.
54
55 .SH OUTPUT
56 .IP "COMMAND"
57 The command name of the process holding the lock.
58 .IP "PID"
59 The process ID of the process which holds the lock or -1 for OFDLCK.
60 .IP "TYPE"
61 The type of lock; can be FLOCK (created with \fBflock\fR(2)), POSIX
62 (created with \fBfcntl\fR(2) and \fBlockf\fR(3)) or OFDLCK (created with fcntl(2).
63 .IP "SIZE"
64 Size of the locked file.
65 .IP "MODE"
66 The lock's access permissions (read, write). If the process is blocked and waiting for the lock,
67 then the mode is postfixed with an '*' (asterisk).
68 .IP "M"
69 Whether the lock is mandatory; 0 means no (meaning the lock is only advisory), 1 means yes.
70 (See \fBfcntl\fR(2).)
71 .IP "START"
72 Relative byte offset of the lock.
73 .IP "END"
74 Ending offset of the lock.
75 .IP "PATH"
76 Full path of the lock. If none is found, or there are no permissions to read
77 the path, it will fall back to the device's mountpoint and "..." is appended to
78 the path. The path might be truncated; use
79 \fB\-\-notruncate\fR to get the full path.
80 .IP "BLOCKER"
81 The PID of the process which blocks the lock.
82
83 .SH NOTES
84 .nf
85 The \fBlslocks\fR command is meant to replace the \fBlslk\fR(8) command,
86 originally written by Victor A. Abell <abe@purdue.edu> and unmaintained
87 since 2001.
88 .fi
89
90 .SH AUTHORS
91 .nf
92 Davidlohr Bueso <dave@gnu.org>
93 .fi
94
95 .SH "SEE ALSO"
96 .BR flock (1),
97 .BR fcntl (2),
98 .BR lockf (3)
99
100 .SH AVAILABILITY
101 The lslocks command is part of the util-linux package and is available from
102 https://www.kernel.org/pub/linux/utils/util-linux/.