nl

Updated: February 11, 2024

Number lines of files.


nl (like cat -n)

nl distros.txt | head

-i number   # set number incrementation
-p          # do not reset page numbering at beginning of each logical page
-w width    # set width of line number field (default is 6)
-n format   # where format is:
    ln = left justified
    rn = right justified
    rz = right justified with leading zeros

## markup
\:\:\:      # start of logical page header
\:\:        # start of logical page body
\:          # start of logical page footer

-b style where style is one of the following:
    a = number all lines
    t = number non-blank lines (default)
    n = none
    pregexp = number on lines matching regex
    
-f style    # set footer numbering to style
-h style    # set header numbering to style