nl

Number lines of input (POSIX, toybox)

Syntax:

nl [-E] [-l num_blank] [-b mode] [-n style] [-s separator]
   [-v line_num] [-w width] [file...]

Runs on:

QNX OS

Options:

-b mode
Which lines to number:
  • a — all
  • pREGEX — pattern
  • t — non-empty (default)
-E
Use extended regex syntax (when doing -b pREGEX).
-l num_blank
("el") Only count the last line of the specified number of consecutive blank lines.
-n style
Numbering style. Valid formats are:
  • ln — left justified
  • rn — right justified
  • rz — zero padding
-s separator
Separator to use between a number and line (instead of using tab).
-v line_num
Starting line number for each section (default 1).
-w width
Width of the line numbers (default 6).
file
The pathname of a file to use as input.

Description:

This utility is provided as part of the toybox package. For information on how to enable it, see toybox.

Contributing author:

Rob Landley and the toybox project (see https://landley.net/toybox/).

Page updated: