{
    "mode": "man",
    "parameter": "run-parts",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/run-parts/8/json",
    "generated": "2026-05-30T08:17:19Z",
    "synopsis": "run-parts    [--test]    [--verbose]   [--debug]   [--report]   [--lsbsysinit]   [--regex=RE]\n[--umask=umask] [--arg=argument] [--exit-on-error] [--help] [--version] [--list]  [--reverse]\n[--] DIRECTORY\nrun-parts -V",
    "sections": {
        "NAME": {
            "content": "run-parts - run scripts or programs in a directory\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "run-parts    [--test]    [--verbose]   [--debug]   [--report]   [--lsbsysinit]   [--regex=RE]\n[--umask=umask] [--arg=argument] [--exit-on-error] [--help] [--version] [--list]  [--reverse]\n[--] DIRECTORY\n\nrun-parts -V\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "run-parts  runs  all  the executable files named within constraints described below, found in\ndirectory directory.  Other files and directories are silently ignored.\n\nIf neither the --lsbsysinit option nor the --regex option is given then the names  must  con‐\nsist  entirely  of  ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and\nASCII minus-hyphens.\n\nIf the --lsbsysinit option is given, then the names must not end in .dpkg-old  or  .dpkg-dist\nor  .dpkg-new  or  .dpkg-tmp, and must belong to one or more of the following namespaces: the\nLANANA-assigned  namespace  (^[a-z0-9]+$);  the  LSB  hierarchical  and  reserved  namespaces\n(^?([a-z0-9.]+-)+[a-z0-9]+$); and the Debian cron script namespace (^[a-zA-Z0-9-]+$).\n\nIf  the  --regex option is given, the names must match the custom extended regular expression\nspecified as that option's argument.\n\nFiles are run sequentially in the lexical sort order (according to the C/POSIX locale charac‐\nter  collation rules) of their names unless the --reverse option is given, in which case they\nare run in the opposite order.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "--test print the names of the scripts which would be run, but don't actually run them.\n\n--list print the names of the all matching files (not limited to executables), but don't  ac‐\ntually run them.  This option cannot be used with --test.\n",
            "subsections": [
                {
                    "name": "-v, --verbose",
                    "content": "print the name of each script to stderr before running.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "--report",
                    "content": "similar  to  --verbose, but only prints the name of scripts which produce output.  The\nscript's name is printed to whichever of stdout or stderr the  script  first  produces\noutput on.\n",
                    "long": "--report"
                },
                {
                    "name": "-d, --debug",
                    "content": "print to stderr which scripts get selected for running and which don't.\n",
                    "flag": "-d",
                    "long": "--debug"
                },
                {
                    "name": "--reverse",
                    "content": "reverse the scripts' execution order.\n",
                    "long": "--reverse"
                },
                {
                    "name": "--exit-on-error",
                    "content": "exit as soon as a script returns with a non-zero exit code.\n",
                    "long": "--exit-on-error"
                },
                {
                    "name": "--lsbsysinit",
                    "content": "use LSB namespaces instead of classical behavior.\n",
                    "long": "--lsbsysinit"
                },
                {
                    "name": "--new-session",
                    "content": "run  each  script in a separate process session.  If you use this option, killing run-\nparts will not kill the currently running script, it will run until completion.\n\n--regex=RE\nvalidate filenames against custom extended regular expression RE.   See  the  EXAMPLES\nsection for an example.\n",
                    "long": "--new-session"
                },
                {
                    "name": "-u, --umask=",
                    "content": "sets  the umask to umask before running the scripts.  umask should be specified in oc‐\ntal.  By default the umask is set to 022.\n",
                    "flag": "-u"
                },
                {
                    "name": "-a, --arg=",
                    "content": "pass argument to the scripts.  Use --arg once for each argument you want passed.\n\n--     specifies that this is the end of the options.  Any filename after -- will be  not  be\ninterpreted as an option even if it starts with a hyphen.\n",
                    "flag": "-a"
                },
                {
                    "name": "-h, --help",
                    "content": "display usage information and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V, --version",
                    "content": "display version and copyright and exit.\n\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "EXAMPLES": {
            "content": "Print the names of all files in /etc that start with `p' and end with `d':\n\nrun-parts --list --regex '^p.*d$' /etc\n\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright (C) 1994 Ian Jackson.\n\nCopyright (C) 1996 Jeff Noxon.\n\nCopyright (C) 1996, 1997, 1998 Guy Maor\n\nCopyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Clint Adams\n\nrun-parts is free software; see the GNU General Public License version 2 or later for copying\nconditions.  There is no warranty.\n\n\n\nDebian                                       27 Jun 2012                                RUN-PARTS(8)",
            "subsections": []
        }
    },
    "summary": "run-parts - run scripts or programs in a directory",
    "flags": [
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "print the name of each script to stderr before running."
        },
        {
            "flag": "",
            "long": "--report",
            "arg": null,
            "description": "similar to --verbose, but only prints the name of scripts which produce output. The script's name is printed to whichever of stdout or stderr the script first produces output on."
        },
        {
            "flag": "-d",
            "long": "--debug",
            "arg": null,
            "description": "print to stderr which scripts get selected for running and which don't."
        },
        {
            "flag": "",
            "long": "--reverse",
            "arg": null,
            "description": "reverse the scripts' execution order."
        },
        {
            "flag": "",
            "long": "--exit-on-error",
            "arg": null,
            "description": "exit as soon as a script returns with a non-zero exit code."
        },
        {
            "flag": "",
            "long": "--lsbsysinit",
            "arg": null,
            "description": "use LSB namespaces instead of classical behavior."
        },
        {
            "flag": "",
            "long": "--new-session",
            "arg": null,
            "description": "run each script in a separate process session. If you use this option, killing run- parts will not kill the currently running script, it will run until completion. --regex=RE validate filenames against custom extended regular expression RE. See the EXAMPLES section for an example."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "sets the umask to umask before running the scripts. umask should be specified in oc‐ tal. By default the umask is set to 022."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "pass argument to the scripts. Use --arg once for each argument you want passed. -- specifies that this is the end of the options. Any filename after -- will be not be interpreted as an option even if it starts with a hyphen."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "display usage information and exit."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "display version and copyright and exit."
        }
    ],
    "examples": [
        "Print the names of all files in /etc that start with `p' and end with `d':",
        "run-parts --list --regex '^p.*d$' /etc"
    ],
    "see_also": []
}