NL(1V) — UNIX Programmer’s Manual
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
−btypeSpecifies which body lines are to be numbered. The recognised types are:
anumber all lines
tnumber just those lines with printable text
pregexpnumber all lines which match the given regular expression
ndo not number any lines
The default type is t.
−htypeAs for −b but for the header. The default type is n.
−ftypeAs for −b but for the footer. The default type is n.
−pDo not restart line numbering at logical page breaks.
−vstartSet the initial page number. Default value is 1.
−iincrLine number increment. Default value is 1.
−sseparThe 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.
−nfmtThe line numbering format. Valid formats are:
lnleft justified, leading zeroes supressed
rnright justified, leading zeroes supressed
rzright justified, leading zeroes left in.
−lnumThe 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).
−dstThe 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
4th Berkeley Distribution