{
    "content": [
        {
            "type": "text",
            "text": "# LSLOCKS (man)\n\n## NAME\n\nlslocks - list local system locks\n\n## SYNOPSIS\n\nlslocks [options]\n\n## DESCRIPTION\n\nlslocks lists information about all the currently held file locks in a Linux system.\n\n## TLDR\n\n> List local system locks.\n\n- List all local system locks:\n  `lslocks`\n- List locks with defined column headers:\n  `lslocks {{-o|--output}} {{PID,COMMAND,PATH,...}}`\n- List locks producing a raw output (no columns), and without column headers:\n  `lslocks {{-r|--raw}} {{-n|--noheadings}}`\n- List locks by PID input:\n  `lslocks {{-p|--pid}} {{process_id}}`\n- List locks with JSON output to `stdout`:\n  `lslocks {{-J|--json}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (11 subsections)\n- **OUTPUT**\n- **NOTES**\n- **AUTHORS**\n- **SEE ALSO**\n- **REPORTING BUGS**\n- **AVAILABILITY**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "LSLOCKS",
        "section": "",
        "mode": "man",
        "summary": "lslocks - list local system locks",
        "synopsis": "lslocks [options]",
        "tldr_summary": "List local system locks.",
        "tldr_examples": [
            {
                "description": "List all local system locks",
                "command": "lslocks"
            },
            {
                "description": "List locks with defined column headers",
                "command": "lslocks {{-o|--output}} {{PID,COMMAND,PATH,...}}"
            },
            {
                "description": "List locks producing a raw output (no columns), and without column headers",
                "command": "lslocks {{-r|--raw}} {{-n|--noheadings}}"
            },
            {
                "description": "List locks by PID input",
                "command": "lslocks {{-p|--pid}} {{process_id}}"
            },
            {
                "description": "List locks with JSON output to `stdout`",
                "command": "lslocks {{-J|--json}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-b",
                "long": "--bytes",
                "arg": null,
                "description": "Print the SIZE column in bytes rather than in a human-readable format."
            },
            {
                "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": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display version information and exit."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "Display help text 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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-b --bytes",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--bytes"
                    },
                    {
                        "name": "-i --noinaccessible",
                        "lines": 2,
                        "flag": "-i",
                        "long": "--noinaccessible"
                    },
                    {
                        "name": "-J --json",
                        "lines": 2,
                        "flag": "-J",
                        "long": "--json"
                    },
                    {
                        "name": "-n --noheadings",
                        "lines": 2,
                        "flag": "-n",
                        "long": "--noheadings"
                    },
                    {
                        "name": "-o --output",
                        "lines": 5,
                        "flag": "-o",
                        "long": "--output"
                    },
                    {
                        "name": "--output-all",
                        "lines": 2,
                        "long": "--output-all"
                    },
                    {
                        "name": "-p --pid",
                        "lines": 2,
                        "flag": "-p",
                        "long": "--pid"
                    },
                    {
                        "name": "-r --raw",
                        "lines": 2,
                        "flag": "-r",
                        "long": "--raw"
                    },
                    {
                        "name": "-u --notruncate",
                        "lines": 2,
                        "flag": "-u",
                        "long": "--notruncate"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "lines": 2,
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "OUTPUT",
                "lines": 35,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 6,
                "subsections": []
            }
        ],
        "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 SIZE column in bytes rather than in a human-readable format.\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": "-V --version",
                        "content": "Display version information and exit.\n",
                        "flag": "-V",
                        "long": "--version"
                    },
                    {
                        "name": "-h --help",
                        "content": "Display help text and exit.\n",
                        "flag": "-h",
                        "long": "--help"
                    }
                ]
            },
            "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/karelzak/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\n\n\nutil-linux 2.37.2                            2021-06-02                                   LSLOCKS(8)",
                "subsections": []
            }
        }
    }
}