NL(1V)

NAME
nl - number lines

SYNOPSIS
/usr/5bin/nl [ -htype ] [ -btype ] [ -ftype ] [ -vstart ] [ -iincr ] [ -p ] [ -lnum ] [ -ssepar ] [ -wwidth ] [ -nfmt ] [ -ddelim ] filename

DESCRIPTION
Nl reads lines from filename (standard input if none named), numbers them according to the options specified, and writes them to standard output.

It regards the text as a series of logical pages. Line numbering is usually reset at the top of each page. A page comprises a header, a body and a footer. These sections are specified by input lines consisting solely of the appropriate delimiter characters:

\:\:\:
    start of header

\:\:
    start of body

\:  start of footer

Nl assumes that the text is in a single logical page body unless told otherwise.

OPTIONS

-btype
    Specifies which body lines are to be numbered. The recognised types are:
    a   number all lines
    t   number just those lines with printable text
    pregexp
        number all lines which match the given regular expression
    n   do not number any lines

    The default type is t.

-htype
    As for -b but for the header. The default type is n.

-ftype
    As for -b but for the footer. The default type is n.

-p  Do not restart line numbering at logical page breaks.

-vstart
    Set the initial page number. Default value is 1.

-iincr
    Line number increment. Default value is 1.

-ssepar
    The character used to separate the line number and the rest of the line. Default is TAB.

-wwidth
    The width (in characters) of the field to print the line number in. Default value is 6.

-nfmt
    The line numbering format. Valid formats are:
    ln  left justified, leading zeroes supressed
    rn  right justified, leading zeroes supressed
    rz  right justified, leading zeroes left in.

-lnum
    The number of adjacent blank lines to consider as one line. For example, -l4 causes nl to number only every fourth blank line (assuming that the numbering of blank lines has been selected).

-dst
    The delimiter characters to mark the header, body and footer sections are altered from the default `\:' to the characters s and t. If only one character is supplied, then the second will be default to `:'. Be careful to protect the delimiter characters from expansion by the shell.

SEE ALSO
cat(1), pr(1)