1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/nl.md
2021-03-30 10:44:21 -03:00

24 lines
541 B
Markdown

# nl
> A utility for numbering lines, either from a file, or from standard input.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/nl-invocation.html>.
- 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}}`