{
    "mode": "man",
    "parameter": "lslocks",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/lslocks/8/json",
    "generated": "2026-10-04T13:44:48Z",
    "synopsis": "lslocks [options]",
    "sections": {
        "NAME": {
            "content": "lslocks - list local system locks\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "lslocks [options]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "lslocks lists information about all the currently held file locks in a Linux system.\n\nNote that lslocks also lists OFD (Open File Description) locks, these locks are not\nassociated with any process (PID is -1). OFD locks are associated with the open file\ndescription on which they are acquired. This lock type is available since Linux 3.15, see\nfcntl(2) for more details.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-b --bytes",
                    "content": "Print the sizes in bytes rather than in a human-readable format.\n\nBy default, the unit, sizes are expressed in, is byte, and unit prefixes are in power of\n2^10 (1024). Abbreviations of symbols are exhibited truncated in order to reach a better\nreadability, by exhibiting alone the first letter of them; examples: \"1 KiB\" and \"1 MiB\"\nare respectively exhibited as \"1 K\" and \"1 M\", then omitting on purpose the mention \"iB\",\nwhich is part of these abbreviations.\n",
                    "flag": "-b",
                    "long": "--bytes"
                },
                {
                    "name": "-i --noinaccessible",
                    "content": "Ignore lock files which are inaccessible for the current user.\n",
                    "flag": "-i",
                    "long": "--noinaccessible"
                },
                {
                    "name": "-J --json",
                    "content": "Use JSON output format.\n",
                    "flag": "-J",
                    "long": "--json"
                },
                {
                    "name": "-n --noheadings",
                    "content": "Do not print a header line.\n",
                    "flag": "-n",
                    "long": "--noheadings"
                },
                {
                    "name": "-o --output _",
                    "content": "Specify which output columns to print. Use --help to get a list of all supported columns.\n\nThe default list of columns may be extended if list is specified in the format +list\n(e.g., lslocks -o +BLOCKER).\n",
                    "flag": "-o",
                    "long": "--output"
                },
                {
                    "name": "--output-all",
                    "content": "Output all available columns.\n",
                    "long": "--output-all"
                },
                {
                    "name": "-p --pid _",
                    "content": "Display only the locks held by the process with this pid.\n",
                    "flag": "-p",
                    "long": "--pid"
                },
                {
                    "name": "-r --raw",
                    "content": "Use the raw output format.\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-u --notruncate",
                    "content": "Do not truncate text in columns.\n",
                    "flag": "-u",
                    "long": "--notruncate"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V --version",
                    "content": "Print version and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "OUTPUT": {
            "content": "COMMAND\nThe command name of the process holding the lock.\n\nPID\nThe process ID of the process which holds the lock or -1 for OFDLCK.\n\nTYPE\nThe type of lock; can be FLOCK (created with flock(2)), POSIX (created with fcntl(2) and\nlockf(3)) or OFDLCK (created with fcntl(2)).\n\nSIZE\nSize of the locked file.\n\nMODE\nThe lock’s access permissions (read, write). If the process is blocked and waiting for\nthe lock, then the mode is postfixed with an '*' (asterisk).\n\nM\nWhether the lock is mandatory; 0 means no (meaning the lock is only advisory), 1 means\nyes. (See fcntl(2).)\n\nSTART\nRelative byte offset of the lock.\n\nEND\nEnding offset of the lock.\n\nPATH\nFull path of the lock. If none is found, or there are no permissions to read the path, it\nwill fall back to the device’s mountpoint and \"...\" is appended to the path. The path\nmight be truncated; use --notruncate to get the full path.\n\nBLOCKER\nThe PID of the process which blocks the lock.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "The lslocks command is meant to replace the lslk(8) command, originally written by Victor A.\nAbell <abe@purdue.edu> and unmaintained since 2001.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Davidlohr Bueso <dave@gnu.org>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "flock(1), fcntl(2), lockf(3)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The lslocks command is part of the util-linux package which can be downloaded from Linux\nKernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\nutil-linux 2.39.3                            2023-12-01                                   LSLOCKS(8)",
            "subsections": []
        }
    },
    "summary": "lslocks - list local system locks",
    "flags": [
        {
            "flag": "-b",
            "long": "--bytes",
            "arg": null,
            "description": "Print the sizes in bytes rather than in a human-readable format. By default, the unit, sizes are expressed in, is byte, and unit prefixes are in power of 2^10 (1024). Abbreviations of symbols are exhibited truncated in order to reach a better readability, by exhibiting alone the first letter of them; examples: \"1 KiB\" and \"1 MiB\" are respectively exhibited as \"1 K\" and \"1 M\", then omitting on purpose the mention \"iB\", which is part of these abbreviations."
        },
        {
            "flag": "-i",
            "long": "--noinaccessible",
            "arg": null,
            "description": "Ignore lock files which are inaccessible for the current user."
        },
        {
            "flag": "-J",
            "long": "--json",
            "arg": null,
            "description": "Use JSON output format."
        },
        {
            "flag": "-n",
            "long": "--noheadings",
            "arg": null,
            "description": "Do not print a header line."
        },
        {
            "flag": "-o",
            "long": "--output",
            "arg": null,
            "description": "Specify which output columns to print. Use --help to get a list of all supported columns. The default list of columns may be extended if list is specified in the format +list (e.g., lslocks -o +BLOCKER)."
        },
        {
            "flag": "",
            "long": "--output-all",
            "arg": null,
            "description": "Output all available columns."
        },
        {
            "flag": "-p",
            "long": "--pid",
            "arg": null,
            "description": "Display only the locks held by the process with this pid."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "Use the raw output format."
        },
        {
            "flag": "-u",
            "long": "--notruncate",
            "arg": null,
            "description": "Do not truncate text in columns."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Print version and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "flock",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/flock/1/json"
        },
        {
            "name": "fcntl",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/fcntl/2/json"
        },
        {
            "name": "lockf",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/lockf/3/json"
        }
    ]
}