Полезная информация

Chapter 3. Unix Basics

Table of Contents
3.1. The Online Manual
3.2. GNU Info Files

3.1. The Online Manual

The most comprehensive documentation on FreeBSD is in the form of man pages. Nearly every program on the system comes with a short reference manual explaining the basic operation and various arguments. These manuals can be view with the man command. Use of the man command is simple:

    % man command

command is the name of the command you wish to learn about. For example, to learn more about ls command type:

    % man ls

The online manual is divided up into numbered sections:

  1. User commands

  2. System calls and error numbers

  3. Functions in the C libraries

  4. Device drivers

  5. File formats

  6. Games and other diversions

  7. Miscellaneous information

  8. System maintenance and operation commands

  9. Kernel developers

In some cases, the same topic may appear in more than one section of the on-line manual. For example, there is a chmod user command and a chmod() system call. In this case, you can tell the man command which one you want by specifying the section:

    % man 1 chmod

This will display the manual page for the user command chmod. References to a particular section of the on-line manual are traditionally placed in parenthesis in written documentation, so chmod(1) refers to the chmod user command and chmod(2) refers to the system call.

This is fine if you know the name of the command and simply wish to know how to use it, but what if you cannot recall the command name? You can use man to search for keywords in the command descriptions by using the -k switch:

    % man -k mail

With this command you will be presented with a list of commands that have the keyword ``mail'' in their descriptions. This is actually functionally equivalent to using the apropos command.

So, you are looking at all those fancy commands in /usr/bin but do not even have the faintest idea what most of them actually do? Simply do a

    % cd /usr/bin; man -f *
or
    % cd /usr/bin; whatis *
which does the same thing.