|
NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON |
|
|
|
NL(1) User Commands NL(1)
nl - number lines of files
nl [OPTION]... [FILE]...
Write each FILE to standard output, with line numbers added.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short
options too.
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-b\-b, --body-numbering=STYLE]8;;\
use STYLE for numbering body lines
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-d\-d, --section-delimiter=CC]8;;\
use CC for logical page delimiters
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-f\-f, --footer-numbering=STYLE]8;;\
use STYLE for numbering footer lines
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-h\-h, --header-numbering=STYLE]8;;\
use STYLE for numbering header lines
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-i\-i, --line-increment=NUMBER]8;;\
line number increment at each line
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-l\-l, --join-blank-lines=NUMBER]8;;\
group of NUMBER empty lines counted as one
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-n\-n, --number-format=FORMAT]8;;\
insert line numbers according to FORMAT
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-p\-p, --no-renumber]8;;\
do not reset line numbers for each section
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-s\-s, --number-separator=STRING]8;;\
add STRING after (possible) line number
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-v\-v, --starting-line-number=NUMBER]8;;\
first line number for each section
]8;;https://www.gnu.org/software/coreutils/manual/coreutils.html#nl-w\-w, --number-width=NUMBER]8;;\
use NUMBER columns for line numbers
]8;;https://www.gnu.org/software/coreutils/nl#nl--help\--help]8;;\ display this help and exit
]8;;https://www.gnu.org/software/coreutils/nl#nl--version\--version]8;;\
output version information and exit
Default options are: -bt -d'\:' -fn -hn -i1 -l1 -n'rn' -s<TAB> -v1
-w6
CC are two delimiter characters used to construct logical page
delimiters; a missing second character implies ':'. As a GNU
extension one can specify more than two characters, and also
specifying the empty string (-d '') disables section matching.
STYLE is one of:
a number all lines
t number only nonempty lines
n number no lines
pBRE number only lines that contain a match for the basic
regular expression, BRE
FORMAT is one of:
ln left justified, no leading zeros
rn right justified, no leading zeros
rz right justified, leading zeros
Written by Scott Bartram and David MacKenzie.
Report bugs to: bug-coreutils@gnu.org
GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
General help using GNU software: <https://www.gnu.org/gethelp/>
Report any translation bugs to
<https://translationproject.org/team/>
Copyright © 2026 Free Software Foundation, Inc. License GPLv3+:
GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Full documentation <https://www.gnu.org/software/coreutils/nl>
or available locally via: info '(coreutils) nl invocation'
This page is part of the coreutils (basic file, shell and text
manipulation utilities) project. Information about the project
can be found at ⟨http://www.gnu.org/software/coreutils/⟩. If you
have a bug report for this manual page, see
⟨http://www.gnu.org/software/coreutils/⟩. This page was obtained
from the tarball coreutils-9.11.tar.xz fetched from
⟨http://ftp.gnu.org/gnu/coreutils/⟩ on 2026-05-24. If you
discover any rendering problems in this HTML version of the page,
or you believe there is a better or more up-to-date source for the
page, or you have corrections or improvements to the information
in this COLOPHON (which is not part of the original manual page),
send a mail to man-pages@man7.org
GNU coreutils 9.11 April 2026 NL(1)