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