Meanings of brackets in man pages

  • Meanings of brackets in man pages

Meanings of brackets in man pages

In command-line help, different types of brackets generally carry the following meanings:

  1. Angle brackets <>:
    • Angle brackets denote required arguments—values you must provide when running the command. They’re typically used to express the core syntax and parameters of a command.
    • Example: command <filename> means you must supply a filename as a required argument, e.g., command file.txt.
  2. Square brackets []:
    • Square brackets indicate optional arguments—values you may or may not provide when running the command. They’re commonly used to mark optional parameters and options.
    • Example: command [option] means you can choose to provide an option, e.g., command -v or simply command.
  3. Curly braces {}:
    • Curly braces usually represent a set of choices, indicating that you must select one. These are also called “choice parameter groups.”
    • Example: command {option1 | option2 | option3} means you must pick one of the given options, e.g., command option2.
  4. Parentheses ():
    • Parentheses are generally used to group arguments, clarifying structure and precedence in a command’s syntax.
    • Example: command (option1 | option2) filename means you must choose either option1 or option2 and supply a filename as an argument, e.g., command option1 file.txt.

These bracket conventions are intended to help users understand command syntax and parameter choices so they can use command-line tools correctly. When reading man pages or help text, paying close attention to the meaning and purpose of each bracket type is crucial—it prevents incorrect commands and achieves the desired results.