nl

Number lines in file output or pipeline

Usage: nl [list-of-files]

Standard Input: Used only if no list-of-files is given

Standard Output: Used to display results

SEE ALSO

For more information, see page 217

Useful options:

-ba means number all lines, including blank lines.

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.