tldr/pages/linux/nl.md

16 lines
305 B
Markdown
Raw Normal View History

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