LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lslocks

lists information about all file locks held on the local system

TLDR

List all locks
$ lslocks
copy
List with specific columns
$ lslocks -o PID,COMMAND,PATH
copy
Raw output without headers
$ lslocks --raw --noheadings
copy
List locks for specific PID
$ lslocks --pid [pid]
copy
Output as JSON
$ lslocks --json
copy

SYNOPSIS

lslocks [options]

DESCRIPTION

lslocks lists information about all file locks held on the local system. It shows advisory and mandatory locks, the holding process, and lock details.

PARAMETERS

-o, --output COLUMNS

Specify output columns
-p, --pid PID
Show locks for specific process
-J, --json
JSON output format
-r, --raw
Raw output without formatting
-n, --noheadings
Suppress column headers
-u, --notruncate
Don't truncate output

OUTPUT COLUMNS

COMMAND: Process namePID: Process IDTYPE: Lock type (FLOCK, POSIX, LEASE)SIZE: Size of locked regionPATH: Locked file path

INSTALL

sudo apt install util-linux
copy
sudo dnf install util-linux
copy
sudo pacman -S util-linux
copy
sudo apk add util-linux-misc
copy
sudo zypper install util-linux
copy
brew install util-linux
copy
nix profile install nixpkgs#util-linux
copy

SEE ALSO

flock(1), lsof(8)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid