NL(1)

NAME
nl - number lines

SYNOPSIS
nl [-bdfhilnpvsw?] [--header-numbering style] [--body-numbering style] [--footer-numbering style] [--no-renumber] [--first-page number] [--page-increment number] [--join-blank-lines number] [--number-separator delim] [--number-width number] [--number-format format] [--section-delimiter CC] [--version] [--help]

DESCRIPTION
Nl copies each named file (or stdin if the filename is -) to the standard output, numbering lines as it goes. Nl can produce output in a somewhat baffling array of forms, all modified by the following options:

-h , --header-numbering
    Nl treats each input file as a collection of pages, each with a header, a body, and a trailer. Each of these sections can have its own numbering style, which can be a to number all lines, t to number all nonblank lines, n to not number any lines, and pRE to only number lines that match a given regular expression. -h sets the numbering style for header sections.

-b, --body-numbering
    As -h, except this is the numbering style for body sections.

-f , --footer-numbering
    This sets the numbering style for footer sections.

-p, --no-renumber
    Normally nl restarts the numbering from 1 every time it encounters a new page; -p disables this, so nl will just keep counting up

-v , --first-page number
    Sets the initial line number to whatever you want, instead of 1.

-i , --page-increment
    Increments line numbers by this amount, rather than 1.

-l , --join-blank-lines count
    This options treats runs of blank lines as single lines. If set to something other than zero, blank lines will increment the line number after every run of count lines.

-s , --number-separator delim
    Use delim to separate line numbers from the text we're copying, instead of the default of a single tab character.

-w , --number-width width
    Print line numbers into a field width characters wide, instead of into a 6-character wide field.

-n , --number-format format
    Set the number format to one of three states: ln prints numbers left justified, rn prints numbers right justified (this is the default), and rz prints numbers right justified, zero filled.

-d , --section-delimiter CC
    Nl, as was mentioned earlier, treats each file as a collection of pages. It separates the pages out by finding markers in the text (\: starts a trailer, \:\: starts the body of a page, and \:\:\: starts the header on a page.) You are allowed to change the two letters in a marker, though you may not change the marker.

-? , --help
    Give a help message, then exit.

--version
    Print nl's version number, then exit.

AUTHOR
David Parsons ( orc@pell.chi.il.us )

BUGS
This program was written from looking at the output and manpage of GNU nl, so the only standards that it attempts to follow are what the GNU program looks like. These may not be the standards the rest of the Unix work expects.