tldr/pages/linux/nl.md

16 lines
305 B
Markdown
Raw Normal View History

2016-12-01 00:54:59 +03:00
# nl
> A utility for numbering lines, either from a file, or from standard input.
- Number lines in a file:
2017-04-15 02:05:38 +03:00
`nl {{file}}`
2016-12-01 00:54:59 +03:00
2017-04-15 02:05:38 +03:00
- Number only the lines with printable text:
2016-12-01 00:54:59 +03:00
2017-04-15 02:05:38 +03:00
`nl -t {{file}}`
2016-12-01 00:54:59 +03:00
2017-04-15 02:05:38 +03:00
- Number only the body lines that match a basic regular expression (BRE) pattern:
2016-12-01 00:54:59 +03:00
2017-04-15 02:05:38 +03:00
`nl -b p'FooBar[0-9]' {{file}}`