commands
nl — number lines
Number lines using configurable numbering styles; -ba numbers all body lines including blank ones. Default output includes padding and a tab. Logical section delimiters have special meaning. Example assumes a fresh text-streams lab fixture.
Formal Syntax & Structure
linux syntaxlinux
nl [OPTION]... [FILE]...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -b | option | Body numbering style |
| FILE | operand | Input file |
Return Value
exit status and output
GNU nl writes text with selected line numbering and returns nonzero on read/write errors. A successful result can contain unnumbered lines under the selected numbering style.
Working Example
Example Snippetlinux
nl -ba events.txt