OS Manuals

/usr/bin/getopt

Misc binaries for util-linux

From util-linux-misc 2.42.4-r2 (os), captured 2026-11-05 by running getopt --help (exit 0). permalink

Usage:
 getopt <optstring> <parameters>
 getopt [options] [--] <optstring> <parameters>
 getopt [options] -o|--options <optstring> [options] [--] <parameters>

Parse command options.

Options:
 -a, --alternative             allow long options starting with single -
 -l, --longoptions <longopts>  the long options to be recognized
 -n, --name <progname>         the name under which errors are reported
 -o, --options <optstring>     the short options to be recognized
 -q, --quiet                   disable error reporting by getopt(3)
 -Q, --quiet-output            no normal output
 -s, --shell <shell>           set quoting conventions to those of <shell>
 -T, --test                    test for getopt(1) version
 -u, --unquoted                do not quote the output
 -U, --unknown                 leave unknown options as they are (implies -q)

 -h, --help                    display this help
 -V, --version                 display version

For more details see getopt(1).
Options (12)
OptionDescriptionSource
-a, --alternativeAllow long options to start with a single '-'.help + man
-l, --longoptions longoptsThe long (multi-character) options to be recognized.help + man
-n, --name prognameThe name that will be used by the getopt(3) routines when it reports errors.help + man
-o, --options optstringThe short (one-character) options to be recognized.help + man
-q, --quietDisable error reporting by getopt(3).help + man
-Q, --quiet-outputDo not generate normal output.help + man
-s, --shell shellset quoting conventions to those of <shell>help + man
-T, --testTest if your getopt(1) is this enhanced version or an old version.help + man
-u, --unquotedDo not quote the output.help + man
-U, --unknownLeave unknown options as they are and suppress error messages from getopt(3).help + man
-h, --helpDisplay help text and exit.help + man
-V, --versionDisplay version and exit.help + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.