Читать книгу Linux Bible - Christopher Negus - Страница 90
Understanding command syntax
ОглавлениеMost commands have one or more options that you can add to change the command's behavior. Options typically consist of a single letter preceded by a hyphen. However, you can group single-letter options together or precede each with a hyphen to use more than one option at a time. For example, the following two uses of options for the ls
command are the same:
$ ls -l -a -t $ ls -lat
In both cases, the ls
command is run with the -l
(long listing), -a
(show hidden dot files), and -t
options (list by time).
Some commands include options that are represented by a whole word. To tell a command to use a whole word as an option, you typically precede it with a double hyphen (--
). For example, to use the help option on many commands, you enter --help
on the command line. Without the double hyphen, the letters h
, e
, l
, and p
would be interpreted as separate options. There are some commands that don't follow the double hyphen convention, using a single hyphen before a word, but most commands use double hyphens for word options.