1
2LSLOCKS(8)                   System Administration                  LSLOCKS(8)
3
4
5

NAME

7       lslocks - list local system locks
8

SYNOPSIS

10       lslocks [options]
11
12

DESCRIPTION

14       lslocks  lists information about all the currently held file locks in a
15       Linux system.
16
17       Note that lslocks also lists OFD (Open File Description)  locks,  these
18       locks  are  not associated with any process (PID is -1).  OFD locks are
19       associated with the open file description on which they  are  acquired.
20       This  lock  type  is  available since Linux 3.15, see fcntl(2) for more
21       details.
22
23

OPTIONS

25       -b, --bytes
26              Print the SIZE column in bytes rather than in  a  human-readable
27              format.
28
29       -i, --noinaccessible
30              Ignore lock files which are inaccessible for the current user.
31
32       -J, --json
33              Use JSON output format.
34
35       -n, --noheadings
36              Do not print a header line.
37
38       -o, --output list
39              Specify which output columns to print.  Use --help to get a list
40              of all supported columns.
41
42              The default list of columns may be extended if list is specified
43              in the format +list (e.g., lslocks -o +BLOCKER).
44
45       --output-all
46              Output all available columns.
47
48       -p, --pid pid
49              Display only the locks held by the process with this pid.
50
51       -r, --raw
52              Use the raw output format.
53
54       -u, --notruncate
55              Do not truncate text in columns.
56
57       -V, --version
58              Display version information and exit.
59
60       -h, --help
61              Display help text and exit.
62
63

OUTPUT

65       COMMAND
66              The command name of the process holding the lock.
67
68       PID    The  process  ID  of  the process which holds the lock or -1 for
69              OFDLCK.
70
71       TYPE   The type of lock; can be FLOCK (created  with  flock(2)),  POSIX
72              (created  with  fcntl(2)  and  lockf(3)) or OFDLCK (created with
73              fcntl(2).
74
75       SIZE   Size of the locked file.
76
77       MODE   The lock's access permissions (read, write).  If the process  is
78              blocked  and  waiting  for  the lock, then the mode is postfixed
79              with an '*' (asterisk).
80
81       M      Whether the lock is mandatory; 0 means no (meaning the  lock  is
82              only advisory), 1 means yes.  (See fcntl(2).)
83
84       START  Relative byte offset of the lock.
85
86       END    Ending offset of the lock.
87
88       PATH   Full  path  of the lock.  If none is found, or there are no per‐
89              missions to read the path, it will fall  back  to  the  device's
90              mountpoint and "..." is appended to the path.  The path might be
91              truncated; use --notruncate to get the full path.
92
93       BLOCKER
94              The PID of the process which blocks the lock.
95
96

NOTES

98       The lslocks command is meant to replace the lslk(8) command,
99       originally written by Victor A. Abell <abe@purdue.edu> and unmaintained
100       since 2001.
101
102

AUTHORS

104       Davidlohr Bueso <dave@gnu.org>
105
106

SEE ALSO

108       flock(1), fcntl(2), lockf(3)
109
110

AVAILABILITY

112       The lslocks command is part of the util-linux package and is  available
113       from https://www.kernel.org/pub/linux/utils/util-linux/.
114
115
116
117util-linux                       December 2014                      LSLOCKS(8)
Impressum