• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

lslocks: command not found

by Deepika

lslocks is a Linux command that displays information about current file locks held by processes on the local system. It provides a list of file locks and the processes holding them, including the PID, the name of the process, the type of lock, the device and inode number of the locked file, and the path to the locked file. The information provided by lslocks can be useful in diagnosing issues with file locking and determining which processes are holding locks on specific files.

If you encounter the below error while running the command lslocks:

lslocks: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install util-linux
Ubuntu apt-get install util-linux
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install util-linux
CentOS yum install util-linux
Fedora dnf install util-linux
OS X brew install util-linux
Raspbian apt-get install util-linux

lslocks Command Examples

1. List all local system locks:

# lslocks

2. List locks with defined column headers:

# lslocks --output PID,COMMAND,PATH

3. List locks producing a raw output (no columns), and without column headers:

# lslocks --raw --noheadings

4. List locks by PID input:

# lslocks --pid PID

5. List locks with JSON output to stdout:

# lslocks --json

Filed Under: Linux

Some more articles you might also be interested in …

  1. behat Command Examples (A PHP framework for Behaviour-Driven Development)
  2. ping Command Examples in Linux
  3. “git missing” Command Examples
  4. How to use tar command under Linux
  5. latte-dock: command not found
  6. abbr Command Examples in fish-shell
  7. ccomps: Decompose graphs into their connected components
  8. make Command Examples in Linux
  9. Linux OS Service ‘smartd’
  10. iwconfig Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright