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

OUTPUT

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

NOTES

91       The lslocks command is meant to replace the lslk(8) command,
92       originally written by Victor A. Abell <abe@purdue.edu> and unmaintained
93       since 2001.
94
95

AUTHORS

97       Davidlohr Bueso <dave@gnu.org>
98
99

SEE ALSO

101       flock(1), fcntl(2), lockf(3)
102
103

AVAILABILITY

105       The  lslocks command is part of the util-linux package and is available
106       from https://www.kernel.org/pub/linux/utils/util-linux/.
107
108
109
110util-linux                       December 2014                      LSLOCKS(8)
Impressum