mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-29 19:35:37 +02:00
nl: added read from stdout and number blank lines. (#1903)
This commit is contained in:
parent
00bf27a43e
commit
a8cc78e6b1
1 changed files with 9 additions and 1 deletions
|
@ -2,14 +2,22 @@
|
||||||
|
|
||||||
> A utility for numbering lines, either from a file, or from standard input.
|
> A utility for numbering lines, either from a file, or from standard input.
|
||||||
|
|
||||||
- Number lines in a file:
|
- Number non-blank lines in a file:
|
||||||
|
|
||||||
`nl {{file}}`
|
`nl {{file}}`
|
||||||
|
|
||||||
|
- Read from standard output:
|
||||||
|
|
||||||
|
`cat {{file}} | nl {{options}} -`
|
||||||
|
|
||||||
- Number only the lines with printable text:
|
- Number only the lines with printable text:
|
||||||
|
|
||||||
`nl -t {{file}}`
|
`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:
|
- Number only the body lines that match a basic regular expression (BRE) pattern:
|
||||||
|
|
||||||
`nl -b p'FooBar[0-9]' {{file}}`
|
`nl -b p'FooBar[0-9]' {{file}}`
|
||||||
|
|
Loading…
Add table
Reference in a new issue