man.rst
changeset 1905 fba288d59662
child 1912 8b81a8f0f692
equal deleted inserted replaced
1904:78357d58b7ab 1905:fba288d59662
       
     1 .. -*- coding: utf-8; -*-
       
     2 .. include:: HEADER.rst
       
     3 
       
     4 ===========
       
     5  Man pages
       
     6 ===========
       
     7 .. contents::
       
     8    :local:
       
     9 
       
    10 Man sections
       
    11 ============
       
    12 
       
    13   1 Executable programs or shell commands.
       
    14   2 System calls (functions provided by the kernel).
       
    15   3 Library calls (functions within program libraries).
       
    16   4 Special files (usually found in /dev).
       
    17   5 File formats and conventions eg /etc/passwd.
       
    18   6 Games.
       
    19   7 Miscellaneous (including macro  packages  and  conventions).
       
    20   8 System administration commands (usually only for root).
       
    21 
       
    22 Invoking man
       
    23 ============
       
    24 
       
    25 Search for prog, func, conf file::
       
    26 
       
    27   $ man [<section>] <item>
       
    28 
       
    29 Search by specific keywords::
       
    30 
       
    31   $ man -k <keywords>
       
    32 
       
    33 Viewing inside Emacs::
       
    34 
       
    35   M-x man RET [<section>] <item>
       
    36   M-x man RET -k SPACE <keywords>
       
    37 
       
    38 Sections order
       
    39 ==============
       
    40 ::
       
    41 
       
    42   NAME                - brief prog description
       
    43   SYNOPSIS (USAGE)    - command line options in BNF
       
    44   DESCRIPTION         - long prog description
       
    45   OPTIONS             - long option descriptions
       
    46   ... misc sections ...
       
    47   EXAMPLES
       
    48   EXIT STATUS
       
    49   ENVIRONMENT
       
    50   AVAILABILITY        - whare search source, where home page
       
    51   FILES               - list of files that has effect on program working
       
    52   AUTHORS
       
    53   COPYRIGHT
       
    54   SEE ALSO
       
    55   BUGS                - know issue, how report bug
       
    56   HISTORY
       
    57 
       
    58 Man page showing
       
    59 ================
       
    60 
       
    61 TODO
       
    62 Bolt by print char, back one char and print same char.
       
    63 Underscore by printing undescore, back one char and print char.
       
    64 
       
    65 Development tools
       
    66 =================
       
    67 
       
    68 To preview local man page::
       
    69 
       
    70   $ groff -man -Tascii foo.1            # 7-bit char
       
    71   $ groff -man -Tlatin1 foo.1           # 8-bit char
       
    72   $ groff -man -Tlatin1 foo.1 | less
       
    73   $ groff -a -mandoc -Tlatin1 e.1
       
    74   $ groff -man -Tutf8 foo.1
       
    75 
       
    76   $ man ./foo.1                         # if slashes in path - use file
       
    77 
       
    78   $ mkdir man1
       
    79   $ cp foo.1 man1
       
    80   $ man -M . 1 foo                      # without slashes search in MANPATH item
       
    81                                         # and add /man1 to each item
       
    82 
       
    83 Output format
       
    84 =============
       
    85 
       
    86 Plain text::
       
    87 
       
    88   $ man foo | col -b >.foo.txt
       
    89 
       
    90 PostScript::
       
    91 
       
    92   $ groff -Tps foo >foo.ps
       
    93 
       
    94 DVI::
       
    95 
       
    96   $ groff -Tdvi foo >foo.dvi
       
    97