12

I looked here help.ubuntu.com (and on the german ubuntu-user wiki) but couldnt find an answer.

I dont know what they mean e.g. in the manpage of mpstat:

SYNOPSIS
   mpstat [ -A ] [ -u ] [ -V ] [ -I { keyword [,...] | ALL } ] [ -P { cpu [,...] | ON | ALL } ] [ interval [ count ] ]

when they say -I { keyword [,...] | ALL } or -P { cpu [,...] | ON | ALL }

I would appreciate any clarification.

1

3 Answers 3

16

Command syntax is given in a form that is a bit like Backus-Naur notation, described here.

The braces group together two or more options, one of which must be specified. In the case of -I { keyword [,...] | ALL }, that means you either specify keyword [,...] or ALL.

1
  • What's meaning in the case sed [OPTION]... {script-only-if-no-other-script} [input-file]...? from man sed
    – rosshjb
    Jun 10, 2020 at 22:12
10

Square braces [...] mean that their content is optional and can either be added to the command or not.

Curly brackets containing pipe-separated items { ... | ... } mean that you must specify one of those items.


Example:

my_command [--optional-argument] { --either-this | --or-that }

Given the syntax above, you have those options to call the command:

my_command --either-this
my_command --or-that
my_command --optional-argument --either-this
my_command --optional-argument --or-that
2

Taken from this handy guide,

Some options will have a limited list of choices. A list of choices will be comma seperated and put between braces.

{choice1,choice2} {yes,no}

Where you have -P { cpu [,...] | ON | ALL }, it means you must choose one of the following options. The [,...] part means that you can supply a comma separated list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .