]> git.ipfire.org Git - thirdparty/util-linux.git/blame_incremental - misc-utils/lslocks.8
lsblk: fix heap-use-after-free
[thirdparty/util-linux.git] / misc-utils / lslocks.8
... / ...
CommitLineData
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
7lslocks \- list local system locks
8.SH SYNOPSIS
9.B lslocks
10[options]
11
12.SH DESCRIPTION
13.B lslocks
14lists information about all the currently held file locks in a Linux system.
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.
20
21.SH OPTIONS
22.TP
23.BR \-b , " \-\-bytes"
24Print the SIZE column in bytes rather than in a human-readable format.
25.TP
26.BR \-i , " \-\-noinaccessible"
27Ignore lock files which are inaccessible for the current user.
28.TP
29.BR \-J , " \-\-json"
30Use JSON output format.
31.TP
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
37.B "--help"
38to get a list of all supported columns.
39
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).
42.TP
43.B \-\-output\-all
44Output all available columns.
45.TP
46.BR \-p , " \-\-pid " \fIpid\fP
47Display only the locks held by the process with this \fIpid\fR.
48.TP
49.BR \-r , " \-\-raw"
50Use the raw output format.
51.TP
52.BR \-u , " \-\-notruncate"
53Do not truncate text in columns.
54.TP
55.BR \-V , " \-\-version"
56Display version information and exit.
57.TP
58.BR \-h , " \-\-help"
59Display help text and exit.
60
61.SH OUTPUT
62.IP "COMMAND"
63The command name of the process holding the lock.
64.IP "PID"
65The process ID of the process which holds the lock or -1 for OFDLCK.
66.IP "TYPE"
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).
69.IP "SIZE"
70Size of the locked file.
71.IP "MODE"
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).
74.IP "M"
75Whether the lock is mandatory; 0 means no (meaning the lock is only advisory), 1 means yes.
76(See \fBfcntl\fR(2).)
77.IP "START"
78Relative byte offset of the lock.
79.IP "END"
80Ending offset of the lock.
81.IP "PATH"
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
85\fB\-\-notruncate\fR to get the full path.
86.IP "BLOCKER"
87The PID of the process which blocks the lock.
88
89.SH NOTES
90.nf
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.
94.fi
95
96.SH AUTHORS
97.nf
98Davidlohr Bueso <dave@gnu.org>
99.fi
100
101.SH "SEE ALSO"
102.BR flock (1),
103.BR fcntl (2),
104.BR lockf (3)
105
106.SH AVAILABILITY
107The lslocks command is part of the util-linux package and is available from
108https://www.kernel.org/pub/linux/utils/util-linux/.