Пропустить навигацию.

Как правильно пользоваться man во FreeBSD и что означают цифры после имени команды (в скобках)

Многие пренебрегают изучением руководства man, порой удобней найти описание в Google. Но лучше иметь представление о работе с документацией в FreeBSD, эти знания помогут вам лучше разобраться и понимать тонкости, о которых ниже.

man ИМЯ_КОМАНДЫ

Выведет на экран информацию о требуемой команде из документации к вашей системе. Попробуем разобраться на примере:

man uname

На экране вы должны увидеть выдержку из документацию, приведу её:

UNAME(1) FreeBSD General Commands Manual UNAME(1)

NAME
uname -- display information about the system

SYNOPSIS
uname [-aimnprsv]

DESCRIPTION
The uname command writes the name of the operating system implementation
to standard output. When options are specified, strings representing one
or more system characteristics are written to standard output.

The options are as follows:

-a Behave as though the options -m, -n, -r, -s, and -v were speci-
fied.

-i Write the kernel ident to standard output.

-m Write the type of the current hardware platform to standard out-
put.

-n Write the name of the system to standard output.

-p Write the type of the machine processor architecture to standard
output.

-r Write the current release level of the operating system to stan-
dard output.

-s Write the name of the operating system implementation to standard
output.

-v Write the version level of this release of the operating system
to standard output.

If the -a flag is specified, or multiple flags are specified, all output
is written on a single line, separated by spaces.

ENVIRONMENT
An environment variable composed of the string UNAME_ followed by any
flag to the uname utility (except for -a) will allow the corresponding
data to be set to the contents of the environment variable.

EXIT STATUS
The uname utility exits 0 on success, and >0 if an error occurs.

SEE ALSO
sysctl(3), uname(3), sysctl(8)

STANDARDS
The uname command is expected to conform to the IEEE Std 1003.2
(``POSIX.2'') specification.

HISTORY
The uname command appeared in PWB UNIX.

FreeBSD 7.0 April 2, 2003 FreeBSD 7.0

Первый вопрос который может возникнуть у новичков, что значат цифры в скобках после имени команды?

Эти цифры обозначают номер раздела страницы руководства. В FreeBSD руководство состоит из 9 разделов:

  1. General commands (Основные команды)
  2. System calls and error numbers (Системные вызовы и коды ошибок)
  3. The C libraries (Библиотеки C)
  4. Devices and device drivers (Устройства и драйверы устройств)
  5. File formats (Форматы файлов)
  6. Game instructions (Инструкции к играм)
  7. Miscellaneous information (Всякая всячина)
  8. System maintenance commands (Команды обслуживания системы)
  9. Kernel system interfaces (Системные интерфейсы ядра)

А каждая страница в документации начинается с имени команды, в след за которым указывается номер раздела.

То есть когда вы видите команду с числом в скобках (1), это обозначает что дано описание команды из Основного раздела, а если (8) — то из раздела Команд обслуживания системы.

Чтобы получить страницу документации из нужного вам раздела, просто выполните команду. Для примера две команды:
man 1 uname
man 3 uname