Number lines and write files, writes each FILE to standard output, with line numbers added to some or all of the lines.
If no input file (or &qt;-&qt;&qt; ) is given nl will read from standard input.

nl [options]… [File]…


&qt;-b STYLE&qt;&qt;
Select the numbering style for lines in the body section of each
logical page. When a line is not numbered, the current line number
is not incremented, but the line number separator character is
still prepended to the line.
The styles are:

&qt;a&qt;&qt; number all lines,

&qt;t&qt;&qt; number only nonempty lines (default for body),

&qt;n&qt;&qt; do not number lines (default for header and footer),

&qt;pREGEXP&qt;&qt; number only lines that contain a match for REGEXP.

&qt;-d CD&qt;&qt;
Set the section delimiter characters to CD; default is &qt;:&qt;&qt;. If
only C is given, the second remains &qt;:&qt;&qt;. (Remember to protect &qt;&qt;&qt;
or other metacharacters from shell expansion with quotes or extra

&qt;-f STYLE&qt;&qt;
Analogous to &qt;–body-numbering&qt;&qt;.

&qt;-h STYLE&qt;&qt;
Analogous to &qt;–body-numbering&qt;&qt;.

&qt;-i NUMBER&qt;&qt;
Increment line numbers by NUMBER (default 1).

&qt;-l NUMBER&qt;&qt;
Consider NUMBER (default 1) consecutive empty lines to be one
logical line for numbering, and only number the last one. Where
fewer than NUMBER consecutive empty lines occur, do not number
them. An empty line is one that contains no characters, not even
spaces or tabs.

&qt;-n FORMAT&qt;&qt;
Select the line numbering format (default is &qt;rn&qt;&qt;):

left justified, no leading zeros;

right justified, no leading zeros;

right justified, leading zeros.

Do not reset the line number at the start of a logical page.

&qt;-s STRING&qt;&qt;
Separate the line number from the text line in the output with
STRING (default is the TAB character).

&qt;-v NUMBER&qt;&qt;
Set the initial line number on each logical page to NUMBER
(default 1).

&qt;-w NUMBER&qt;&qt;
Use NUMBER characters for line numbers (default 6).&qt;nl&qt;&qt; decomposes its input into (logical) pages; by default, the line number is reset to 1 at the top of each logical page.

&qt;nl&qt;&qt; treats all of the input files as a single document; it does not reset line numbers or logical pages between files.

A logical page consists of three sections: header, body, and footer. Any of the sections can be empty. Each can be numbered in a different style from the others.

The beginnings of the sections of logical pages are indicated in the input file by a line containing exactly one of these delimiter strings:
&qt;:::&qt;&qt; start of header;
&qt;::&qt;&qt; start of body;
&qt;:&qt;&qt; start of footer.
The two characters from which these strings are made can be changed from &qt;&qt;&qt; and &qt;:&qt;&qt; via options (see above), but the pattern and length of each string cannot be changed. A section delimiter is replaced by an empty line on output.

Any text that comes before the first section delimiter string in the input file is considered to be part of a body section, so &qt;nl&qt;&qt; treats a file that contains no section delimiters as a single body section.