]>
Commit | Line | Data |
---|---|---|
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 | 7 | lslocks \- 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 | 14 | lists information about all the currently held file locks in a Linux system. |
2aaf56c4 KZ |
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. | |
4473c8dc DB |
20 | |
21 | .SH OPTIONS | |
eae1ef2f | 22 | .TP |
51b0bcf0 KZ |
23 | .BR \-b , " \-\-bytes" |
24 | Print the SIZE column in bytes rather than in a human-readable format. | |
25 | .TP | |
f29bc6e1 KZ |
26 | .BR \-i , " \-\-noinaccessible" |
27 | Ignore lock files which are inaccessible for the current user. | |
28 | .TP | |
b3a2e889 KZ |
29 | .BR \-J , " \-\-json" |
30 | Use JSON output format. | |
31 | .TP | |
eae1ef2f BS |
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 | |
4473c8dc DB |
37 | .B "--help" |
38 | to get a list of all supported columns. | |
e68948e1 | 39 | |
37684203 BS |
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). | |
eae1ef2f | 42 | .TP |
25d3c405 SK |
43 | .B \-\-output\-all |
44 | Output all available columns. | |
45 | .TP | |
eae1ef2f BS |
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" | |
4473c8dc | 50 | Use the raw output format. |
eae1ef2f BS |
51 | .TP |
52 | .BR \-u , " \-\-notruncate" | |
53 | Do not truncate text in columns. | |
7ab71099 BS |
54 | .TP |
55 | .BR \-V , " \-\-version" | |
56 | Display version information and exit. | |
57 | .TP | |
58 | .BR \-h , " \-\-help" | |
59 | Display help text and exit. | |
4473c8dc DB |
60 | |
61 | .SH OUTPUT | |
62 | .IP "COMMAND" | |
63 | The command name of the process holding the lock. | |
4473c8dc | 64 | .IP "PID" |
2aaf56c4 | 65 | The process ID of the process which holds the lock or -1 for OFDLCK. |
74fa8244 | 66 | .IP "TYPE" |
4707bc83 KZ |
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). | |
4473c8dc DB |
69 | .IP "SIZE" |
70 | Size of the locked file. | |
74fa8244 | 71 | .IP "MODE" |
eae1ef2f BS |
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). | |
4473c8dc | 74 | .IP "M" |
eae1ef2f | 75 | Whether 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" |
78 | Relative byte offset of the lock. | |
4473c8dc DB |
79 | .IP "END" |
80 | Ending offset of the lock. | |
4473c8dc | 81 | .IP "PATH" |
f29bc6e1 KZ |
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 | |
7ab71099 | 85 | \fB\-\-notruncate\fR to get the full path. |
7badb909 | 86 | .IP "BLOCKER" |
eae1ef2f | 87 | The PID of the process which blocks the lock. |
7badb909 | 88 | |
4473c8dc DB |
89 | .SH NOTES |
90 | .nf | |
7ab71099 BS |
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. | |
4473c8dc DB |
94 | .fi |
95 | ||
96 | .SH AUTHORS | |
97 | .nf | |
98 | Davidlohr 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 | |
107 | The lslocks command is part of the util-linux package and is available from | |
d673b74e | 108 | https://www.kernel.org/pub/linux/utils/util-linux/. |