]>
Commit | Line | Data |
---|---|---|
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 \-b , " \-\-bytes" | |
24 | Print the SIZE column in bytes rather than in a human-readable format. | |
25 | .TP | |
26 | .BR \-i , " \-\-noinaccessible" | |
27 | Ignore lock files which are inaccessible for the current user. | |
28 | .TP | |
29 | .BR \-J , " \-\-json" | |
30 | Use JSON output format. | |
31 | .TP | |
32 | .BR \-n , " \-\-noheadings" | |
33 | Do not print a header line. | |
34 | .TP | |
35 | .BR \-o , " \-\-output " \fIlist\fP | |
36 | Specify which output columns to print. Use | |
37 | .B "--help" | |
38 | to get a list of all supported columns. | |
39 | ||
40 | The default list of columns may be extended if \fIlist\fP is | |
41 | specified in the format \fI+list\fP (e.g. \fBlslocks -o +BLOCKER\fP). | |
42 | .TP | |
43 | .B \-\-output\-all | |
44 | Output all available columns. | |
45 | .TP | |
46 | .BR \-p , " \-\-pid " \fIpid\fP | |
47 | Display only the locks held by the process with this \fIpid\fR. | |
48 | .TP | |
49 | .BR \-r , " \-\-raw" | |
50 | Use the raw output format. | |
51 | .TP | |
52 | .BR \-u , " \-\-notruncate" | |
53 | Do not truncate text in columns. | |
54 | .TP | |
55 | .BR \-V , " \-\-version" | |
56 | Display version information and exit. | |
57 | .TP | |
58 | .BR \-h , " \-\-help" | |
59 | Display help text and exit. | |
60 | ||
61 | .SH OUTPUT | |
62 | .IP "COMMAND" | |
63 | The command name of the process holding the lock. | |
64 | .IP "PID" | |
65 | The process ID of the process which holds the lock or -1 for OFDLCK. | |
66 | .IP "TYPE" | |
67 | The 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" | |
70 | Size of the locked file. | |
71 | .IP "MODE" | |
72 | The lock's access permissions (read, write). If the process is blocked and waiting for the lock, | |
73 | then the mode is postfixed with an '*' (asterisk). | |
74 | .IP "M" | |
75 | Whether the lock is mandatory; 0 means no (meaning the lock is only advisory), 1 means yes. | |
76 | (See \fBfcntl\fR(2).) | |
77 | .IP "START" | |
78 | Relative byte offset of the lock. | |
79 | .IP "END" | |
80 | Ending offset of the lock. | |
81 | .IP "PATH" | |
82 | Full path of the lock. If none is found, or there are no permissions to read | |
83 | the path, it will fall back to the device's mountpoint and "..." is appended to | |
84 | the path. The path might be truncated; use | |
85 | \fB\-\-notruncate\fR to get the full path. | |
86 | .IP "BLOCKER" | |
87 | The PID of the process which blocks the lock. | |
88 | ||
89 | .SH NOTES | |
90 | .nf | |
91 | The \fBlslocks\fR command is meant to replace the \fBlslk\fR(8) command, | |
92 | originally written by Victor A. Abell <abe@purdue.edu> and unmaintained | |
93 | since 2001. | |
94 | .fi | |
95 | ||
96 | .SH AUTHORS | |
97 | .nf | |
98 | Davidlohr 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 | |
107 | The lslocks command is part of the util-linux package and is available from | |
108 | https://www.kernel.org/pub/linux/utils/util-linux/. |