The vital resource for developers creating new command-line tools to learn the wisdom of the ancients.
All programs should universally implement these flags:
-V
(uppercase),--version
,version
--help
,help
(also the default if nothing is given)--
stop processing flags; treat all else as raw arguments
Depending on whether a program primarily interacts with a network, text data, or binary data, it may use these differently:
-a
,--all
-A
,--almost-all
-c
,--config
,--count
-d
,--delimiter
,--data
-E
,--extended-regexp
-F
,--fixed-strings
(no regexp)-v
,--verbose
or--invert-match
-h
,--human-readable
(use suffixes such ask
,m
, andb
for large numbers)-i
,--input
(file to read from),--insensitive
(case insensitive) or--index
(starting value)-f
,--force
,--field
-k
,--insecure
-l
,--list
-u
,--unignore
,--user
-p
,--port
,--preserve
(permissions),--password
-r
,--recursive
,--raw
-q
,--quiet
-F
,classify
-I
,--ignore
-s
,--silent
-y
,--yes
(auto-accept)-n
, number or count-o
,--out
(file to write to)-w
,--write
(replace in-place)-u
,--unix
(formatting, e.g. of time)-O
,--log
-4
, ipv4-6
, ipv6-0
, use C-stringNULL
as delimiter
- the
man
and--help
ofls
,curl
,tar
,grep
, and many others - https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html
- https://www.gnu.org/prep/standards/html_node/Option-Table.html#Option-Table
- https://www.man7.org/linux/man-pages/man3/getopt.3.html
- https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html