Understand synopsis in manpage

  1. The synopsis section usually gives some example use-cases. Sometimes sub-commands have different options, so several examples might be shown.
  2. Brackets [] always denote optional switches, arguments, options, etc.
  3. Yes, the pipe | means or, particularly when inside brackets or parenthesis.
  4. Brackets in brackets just means that the second part is dependent on the first, and also itself optional. Some switches you can use on their own or add a value to them. Commas at the start of a bracket would indicate there can be multiple comma separated values.
  5. They lean on Regex concepts, but are meant to be human readable so don't follow all the escaping rules etc.

If you want a reference, they are loosely based on EBNF.


From man man page :


The following conventions apply to the SYNOPSIS section and can be used as a guide in other sections. man synopsis description

Exact rendering may vary depending on the output device. For instance, man will usually not be able to render italics when running in a terminal, and will typically use underlined or coloured text instead.

The command or function illustration is a pattern that should match all possible invocations. In some cases it is advisable to illustrate several exclusive invocations as is shown in the SYNOPSIS section of this manual page.

Tags:

Man