Name
nl
Synopsis
nl [options
] [file
]
Number the lines of file in logical page segments. Numbering resets to 1 at the start of each logical page. Pages consist of a header, body, and footer; each section may be empty. It is the body that gets numbered. The sections are delimited by special standalone lines as indicated next; the delimiter lines are copied to the output as empty lines.
Section Delimiters
|
Start of header |
|
Start of body |
|
Start of footer |
Common Options
-b
type
,--body-numbering=
type
Number lines according to type. Values are:
|
All lines. |
|
No lines. |
|
Text lines only (the default). |
|
Lines matching the regular expression exp only. |
-d
xy
,--section-delimiter=
xy
Use characters xy to delimit logical pages (default is
\:
).-f
type
,--footer-numbering=
type
Like
-b
, but number footer (default type isn
).-h
type
,--header-numbering=
type
Like
-b
, but number header (default type isn
).-i
n
,--page-increment=
n
Increment each line number by n (default is 1).
-l
n
,--join-blank-lines=
n
Count n consecutive blank lines as one line.
-n
format
,--number-format=
format
Set line number format. Values are:
|
Left-justify, omit leading zeros. |
|
Right-justify, omit leading zeros (default). |
|
Right-justify. |
-p
,--no-renumber
Do not reset numbering at start of pages.
-s
c
,--number-separator=
string
Separate text from line number with character(s) c (default is a tab).
-v
n
,--first-page=
n
Number each page starting at n (default is 1).
-w
n
,--number-width=
n
Use ...
Get Unix in a Nutshell, 4th Edition 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.