I did some searching, but I cannot find documentation on how Unix usage works. I know something (mostly through trial and error) but, for example, how do I know that

/usr/bin/ls  [-aAbcCdeEfFghHilLmnopqrRstuvVx1@] [file]...

means that you can include more than one option? That is,

ls -la

Where is some documentation on what the usage syntax is?

  • POSIX does have some say on how usage/help displays should be formatted, but beyond the core utilities (GNU), few follow it consistently.
    – Tim Post
    Apr 23 '10 at 17:17
  • @Tim, I don't have anything on usage there. Apr 23 '10 at 18:58
  • (please don't take this as a RTFM post it's more a funny comment) you can actually run 'man man' and scroll down to find the syntax guidelines. Dec 18 '14 at 2:19

It's true there is no RFC or anything, but you don't go too far off base if you stick to these guidelines:

  1. Anything in angle brackets < > means the option is required:

  2. Anything in square brackets [ ] means the option is optional:

  3. Options separated by a pipe | means those are the valid values:

  4. Single-letter options start with one dash:

  5. Multi-letter options start with two dashes:

  6. (based on #4) A single dash with multiple letters usually means the union of those individual single-letter options rather than a multi-letter option. Not all commands support that kind of union. Example:
    -aAbBcC is the same as -a -A -b -B -c -C


There is no strict structure for man pages, but the following covers most commands.

From MANUAL PAGES(5), BSD File Formats Manual, section "MANUAL PAGE SYNTAX":

In manual page syntax, anything in a normal text font is required text. Anything in a boldface font is a flag or a subcommand. Anything underlined is a user-specified argument such as a filename.

Any argument surrounded by brackets is considered to be optional. For example, [ filename ] would indicate an optional filename argument.

Flags, arguments, or subcommands separated by a vertical separator (|) are mutually exclusive. For example, if -a turns on an option and -b turns off the option, the syntax for this command might be -a | -b.

In some cases, you may even see entire groups of arguments wrapped with brackets and separated by a vertical separator. This is one way of showing that a command has more than one valid syntax. In other manual pages, this is expressed by having multiple lines in the synopsis, each of which begins with the command name. The separated format is more common (and more readable), but is not always possible for commands with particularly complex syntax.

Finally, the most important notational convention is the use of the ellipsis (...). This indicates that additional arguments may be added at this point.


The usage lines don't follow anything consistent.

You should use man ls or info ls to get a more consistent level of information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.