| NL(1) | General Commands Manual | NL(1) | 
nl —
| nl | [ -p] [-btype] [-ddelim] [-ftype] [-htype] [-iincr] [-lnum] [-nformat] [-ssep] [-vstartnum] [-wwidth] [file] | 
nl utility reads lines from the named
  file, applies a configurable line numbering filter
  operation, and writes the result to the standard output. If
  file is a single dash (‘-’) or absent,
  nl reads from the standard input.
The nl utility treats the text it reads in
    terms of logical pages. Unless specified otherwise, line numbering is reset
    at the start of each logical page. A logical page consists of a header, a
    body and a footer section; empty sections are valid. Different line
    numbering options are independently available for header, body and footer
    sections.
The starts of logical page sections are signaled by input lines containing nothing but one of the following sequences of delimiter characters:
| Line | Start of | 
| \:\:\: | header | 
| \:\: | body | 
| \: | footer | 
If the input does not contain any logical page section signaling directives, the text being read is assumed to consist of a single logical page body.
The following options are available:
-b
    typeThe default type for logical page body lines is t.
-d
    delim-f
    type-b type
      except for logical page footer lines. The default
      type for logical page footer lines is n.-h
    type-b type
      except for logical page header lines. The default
      type for logical page header lines is n.-i
    incr-l
    num-b a,
      -f a or -h a option,
      specify the number of adjacent blank lines to be considered as one. For
      example, -l 2 results in only the second adjacent
      blank line being numbered. The default num value is
      1.-n
    formatThe default format is rn.
-p-s
    sep-v
    startnum-p option. The default
      startnum value is 1.-w
    widthnl utility exits 0 on success,
  and >0 if an error occurs.
nl utility is compliant with the
  X/Open Portability Guide Issue 4, Version 2
  (“XPG4.2”) specification.
nl utility first appeared in
  AT&T System V Release 2 UNIX.
| May 1, 2013 | NetBSD 10.0 |