nl - line numbering filter
nl [ -p ] [ htype ] [ -btype ] [ -ftype ] [ -vstart ] [ -iincr ] [
-lnum ] [ -ssep ] [ -wwidth ] [ -nfmt ] [ -ddelim ] filename
This command is available with the System V software installation
option. Refer to for information on how to install optional software.
nl reads lines from filename (or the standard input), numbers them
according to the options in effect, and sends its output to the stan-
nl views the text it reads in terms of logical pages. Line numbering
is normally reset at the start of each page. A logical page is com-
posed of header, body and footer sections. The start of each page sec-
tion is signaled by input lines containing section delimiters only:
Start of file
Empty sections are valid. Different line-numbering options are avail-
able within each section. The default scheme is no numbering for head-
ers and footers.
-p Do not restart numbering at logical page delimiters.
-btype Specify which logical page body lines are to be numbered. type
is one of:
a number all lines
t number lines with printable text only (the default)
n no line numbering
p rexp number only lines that contain the regular expression
-htype Same as -btype except for the header. The default type for the
logical page header is n (no lines numbered).
-ftype Same as -btype except for the footer. The default for logical
page footer is n (no lines numbered).
start is the initial value used to number logical page lines.
The default is 1.
-iincr incr is the increment by which to number logical page lines.
The default is 1.
-ssep sep is the character(s) used to separate the line number from
the corresponding text line. The default is a TAB.
width is the number of characters to be used for the line-number
field. The default is 6.
-nfmt fmt is the line numbering format. Recognized values are:
rn right justified, leading zeroes suppressed (the default)
ln left justified, leading zeroes suppressed
rz right justified, leading zeroes kept
-lnum num is the number of blank lines to be considered as one. For
example, -l2 results in only the second adjacent blank being
numbered (if the appropriate -ha, -ba, and/or -fa option is
set). The default is 1.
-dxx The delimiter characters specifying the start of a logical page
section may be changed from the default characters (\:) to two
user-specified characters. If only one character is entered,
the second character remains the default character (:). No
space should appear between the -d and the delimiter characters.
To enter a backslash, use two backslashes.
nl -v10 -i10 -d!+ filename1
will number filename1 starting at line number 10 with an increment of
ten. The logical page delimiters are !+.
17 September 1989 NL(1V)