- Number non-blank lines in a file:nl [file]- Read from standard output:cat [file] | nl [options] -- Number only the lines with printable text:nl -t [file]- Number all lines including blank lines:nl -b a [file]- Number only the body lines that match a basic regular expression (BRE) pattern:nl -b p'FooBar[0-9]' [file]
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.
By default, selects -v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn. CC are two delimiter characters used to construct logical page delimiters, a missing second character implies :. Type \\ for \. STYLE is one of:
FORMAT is one of:
Written by Scott Bartram and David MacKenzie.
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report nl translation bugs to <http://translationproject.org/team/>
Copyright © 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://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 at: <http://www.gnu.org/software/coreutils/nl> or available locally via: info '(coreutils) nl invocation'