{
    "content": [
        {
            "type": "text",
            "text": "# timeout (man)\n\n## NAME\n\ntimeout - run a command with a time limit\n\n## SYNOPSIS\n\ntimeout [OPTION] DURATION COMMAND [ARG]...\ntimeout [OPTION]\n\n## DESCRIPTION\n\nStart COMMAND, and kill it if still running after DURATION.\n\n## TLDR\n\n> Run a command with a time limit.\n\n- Run `sleep 10` and terminate it after 3 seconds:\n  `timeout 3s sleep 10`\n- Send a signal to the command after the time limit expires (`TERM` by default, `kill -l` to list all signals):\n  `timeout {{-s|--signal}} {{INT|HUP|KILL|...}} {{5s}} {{sleep 10}}`\n- Send verbose output to `stderr` showing signal sent upon timeout:\n  `timeout {{-v|--verbose}} {{0.5s|1m|1h|1d|...}} {{command}}`\n- Preserve the exit status of the command regardless of timing out:\n  `timeout {{-p|--preserve-status}} {{1s|1m|1h|1d|...}} {{command}}`\n- Send a forceful `KILL` signal after certain duration if the command ignores initial signal upon timeout:\n  `timeout {{-k|--kill-after}} {{5m}} {{30s}} {{command}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (7 subsections)\n- **BUGS**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "timeout",
        "section": "",
        "mode": "man",
        "summary": "timeout - run a command with a time limit",
        "synopsis": "timeout [OPTION] DURATION COMMAND [ARG]...\ntimeout [OPTION]",
        "tldr_summary": "Run a command with a time limit.",
        "tldr_examples": [
            {
                "description": "Run `sleep 10` and terminate it after 3 seconds",
                "command": "timeout 3s sleep 10"
            },
            {
                "description": "Send a signal to the command after the time limit expires (`TERM` by default, `kill -l` to list all signals)",
                "command": "timeout {{-s|--signal}} {{INT|HUP|KILL|...}} {{5s}} {{sleep 10}}"
            },
            {
                "description": "Send verbose output to `stderr` showing signal sent upon timeout",
                "command": "timeout {{-v|--verbose}} {{0.5s|1m|1h|1d|...}} {{command}}"
            },
            {
                "description": "Preserve the exit status of the command regardless of timing out",
                "command": "timeout {{-p|--preserve-status}} {{1s|1m|1h|1d|...}} {{command}}"
            },
            {
                "description": "Send a forceful `KILL` signal after certain duration if the command ignores initial signal upon timeout",
                "command": "timeout {{-k|--kill-after}} {{5m}} {{30s}} {{command}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "",
                "long": "--preserve-status",
                "arg": null,
                "description": "exit with the same status as COMMAND, even when the command times out"
            },
            {
                "flag": "",
                "long": "--foreground",
                "arg": null,
                "description": "when not running timeout directly from a shell prompt, allow COMMAND to read from the TTY and get TTY signals; in this mode, children of COM‐ MAND will not be timed out"
            },
            {
                "flag": "-k",
                "long": "--kill-after",
                "arg": null,
                "description": "also send a KILL signal if COMMAND is still running this long after the initial signal was sent"
            },
            {
                "flag": "-s",
                "long": "--signal",
                "arg": null,
                "description": "specify the signal to be sent on timeout; SIGNAL may be a name like 'HUP' or a number; see 'kill -l' for a list of signals"
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "diagnose to stderr any signal sent upon timeout --help display this help and exit"
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "output version information and exit DURATION is a floating point number with an optional suffix: 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days. A duration of 0 disables the associated timeout. Upon timeout, send the TERM signal to COMMAND, if no other SIGNAL specified. The TERM signal kills any process that does not block or catch that signal. It may be necessary to use the KILL signal, since this signal can't be caught."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "kill",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/kill/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": [
                    {
                        "name": "--preserve-status",
                        "lines": 4,
                        "long": "--preserve-status"
                    },
                    {
                        "name": "--foreground",
                        "lines": 5,
                        "long": "--foreground"
                    },
                    {
                        "name": "-k --kill-after",
                        "lines": 4,
                        "flag": "-k",
                        "long": "--kill-after"
                    },
                    {
                        "name": "-s --signal",
                        "lines": 4,
                        "flag": "-s",
                        "long": "--signal"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 4,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "--version",
                        "lines": 10,
                        "long": "--version"
                    },
                    {
                        "name": "Exit status:",
                        "lines": 12
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "timeout - run a command with a time limit\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "timeout [OPTION] DURATION COMMAND [ARG]...\ntimeout [OPTION]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Start COMMAND, and kill it if still running after DURATION.\n\nMandatory arguments to long options are mandatory for short options too.\n",
                "subsections": [
                    {
                        "name": "--preserve-status",
                        "content": "exit with the same status as COMMAND, even when the\n\ncommand times out\n",
                        "long": "--preserve-status"
                    },
                    {
                        "name": "--foreground",
                        "content": "when not running timeout directly from a shell prompt,\n\nallow COMMAND to read from the TTY and get TTY signals; in this mode, children of COM‐\nMAND will not be timed out\n",
                        "long": "--foreground"
                    },
                    {
                        "name": "-k --kill-after",
                        "content": "also send a KILL signal if COMMAND is still running\n\nthis long after the initial signal was sent\n",
                        "flag": "-k",
                        "long": "--kill-after"
                    },
                    {
                        "name": "-s --signal",
                        "content": "specify the signal to be sent on timeout;\n\nSIGNAL may be a name like 'HUP' or a number; see 'kill -l' for a list of signals\n",
                        "flag": "-s",
                        "long": "--signal"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "diagnose to stderr any signal sent upon timeout\n\n--help display this help and exit\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "--version",
                        "content": "output version information and exit\n\nDURATION  is  a floating point number with an optional suffix: 's' for seconds (the default),\n'm' for minutes, 'h' for hours or 'd' for days.  A duration  of  0  disables  the  associated\ntimeout.\n\nUpon timeout, send the TERM signal to COMMAND, if no other SIGNAL specified.  The TERM signal\nkills  any  process that does not block or catch that signal.  It may be necessary to use the\nKILL signal, since this signal can't be caught.\n",
                        "long": "--version"
                    },
                    {
                        "name": "Exit status:",
                        "content": "124    if COMMAND times out, and --preserve-status is not specified\n\n125    if the timeout command itself fails\n\n126    if COMMAND is found but cannot be invoked\n\n127    if COMMAND cannot be found\n\n137    if COMMAND (or timeout itself) is sent the KILL (9) signal (128+9)\n\n-      the exit status of COMMAND otherwise\n"
                    }
                ]
            },
            "BUGS": {
                "content": "Some platforms don't currently support timeouts beyond the year 2038.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Written by Padraig Brady.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright © 2023 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "kill(1)\n\nFull documentation <https://www.gnu.org/software/coreutils/timeout>\nor available locally via: info '(coreutils) timeout invocation'\n\nGNU coreutils 9.4                           January 2026                                  TIMEOUT(1)",
                "subsections": []
            }
        }
    }
}