General command form¶
In a shell (
bash here), there are a multitude of commands accessible by the command interpreter.
However, these commands (almost) all follow the same syntax:
command [option] [argument]
commandis the name of the command to be executed
[argument]means that the options and arguments are optional. So the command can be called alone and will then be executed with its default options.
The various components of the commands are separated by spaces.
[option]corresponds to the options. They are usually of the form
-o(with a dash) or
--option(long version with two dashes). Options can sometimes be followed by arguments specific to the options (for example
--option=toto). If several options are defined, they can often be abbreviated (eg
[argument]matches the command's own arguments.
ls ls directory ls -d directory ls -l -a ls -la ls -la directory