NL(1)

๐Ÿ’– NL(1) โ€” bestie, it's the number-lines page ๐Ÿ’–

okay so this is the manual for nl, a lil User Command that lives in GNU coreutils. Full name, no nickname needed: it's nl, and it numbers lines of files. That's the whole job. It does it beautifully. ๐Ÿ’…


โœจ NAME โœจ

nl โ€” number lines of files ๐ŸŒธ


โœจ SYNOPSIS โœจ

nl [OPTION]... [FILE]...

โœจ DESCRIPTION โœจ

So here's the vibe: nl writes each FILE out to standard output, but with line numbers added. That's it. That's the whole main character arc. ๐Ÿฆ‹

And if you don't give it any FILE at all, or you pass - as a FILE, it reads standard input. So it plays nice in pipes, no cap.

Heads up bestie: mandatory arguments to long options are also mandatory for the short options. So like, you can't just skip the value because you used the short flag. It's giving "the rule applies both ways." ๐Ÿ˜ญ

๐ŸŽ€ the options (there's a lot, but we're doing all of them, periodt)

  • -b, --body-numbering=STYLE โ€” use STYLE for numbering body lines ๐Ÿ’–
  • -d, --section-delimiter=CC โ€” use CC for logical page delimiters
  • -f, --footer-numbering=STYLE โ€” use STYLE for numbering footer lines
  • -h, --header-numbering=STYLE โ€” use STYLE for numbering header lines
  • -i, --line-increment=NUMBER โ€” the line number increment at each line
  • -l, --join-blank-lines=NUMBER โ€” a group of NUMBER empty lines gets counted as one ๐Ÿ‘‘
  • -n, --number-format=FORMAT โ€” insert line numbers according to FORMAT
  • -p, --no-renumber โ€” do not reset line numbers for each section
  • -s, --number-separator=STRING โ€” add STRING after the (possible) line number
  • -v, --starting-line-number=NUMBER โ€” first line number for each section
  • -w, --number-width=NUMBER โ€” use NUMBER columns for line numbers
  • --help โ€” display this help and exit ๐ŸŒˆ
  • --version โ€” output version information and exit

๐ŸŒŸ the default vibe check

The default options are literally:

-bt -d'\:' -fn -hn -i1 -l1 -n'rn' -s<TAB> -v1 -w6

Like, that's the factory setting. Slay. โœจ

๐Ÿ”ฅ about CC (the delimiters)

CC are two delimiter characters used to construct logical page delimiters. If the second character is missing, it's implied to be ':'. And as a GNU extension, you can actually specify more than two characters โ€” and you can also specify the empty string, i.e. -d '', which disables section matching entirely. Not me giving you options on top of options ๐Ÿ™ˆ

๐Ÿ’€ 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

โœจ AUTHOR โœจ

Written by Scott Bartram and David MacKenzie. ๐Ÿซถ Legends, fr fr.


โœจ REPORTING BUGS โœจ

Found a bug? Don't suffer in silence bestie, tell the people:


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. ๐Ÿ˜ญ (say it louder for the people in the back)

โœจ SEE ALSO โœจ


And that's the page, bestie!! This whole thing came out of GNU coreutils 9.12, dated September 2026, and it's the NL(1) manual โ€” go number some lines, you absolute icon ๐Ÿ’–โœจ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from