mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-29 22:55:34 +02:00
nl: adjustments per code review
This commit is contained in:
parent
60ebf37f35
commit
d3f01ac91c
1 changed files with 5 additions and 14 deletions
|
@ -4,21 +4,12 @@
|
||||||
|
|
||||||
- Number lines in a file:
|
- Number lines in a file:
|
||||||
|
|
||||||
`nl {{source_file}}`
|
`nl {{file}}`
|
||||||
|
|
||||||
- Number lines where there is printable text only:
|
- Number only the lines with printable text:
|
||||||
|
|
||||||
`nl -t {{source_file}}`
|
`nl -t {{file}}`
|
||||||
|
|
||||||
- Number lines that match a regular expression (Starting with a Capital
|
- Number only the body lines that match a basic regular expression (BRE) pattern:
|
||||||
A is Exampled):
|
|
||||||
|
|
||||||
`nl -b p^A {{source_file}}`
|
|
||||||
|
|
||||||
- Can be useful as an alternative to grep {{source_file}} -n
|
|
||||||
{{search_term}}:
|
|
||||||
|
|
||||||
`nl ./file | grep match`
|
|
||||||
|
|
||||||
Which outputs `{{line_number}} {{search_term}}`
|
|
||||||
|
|
||||||
|
`nl -b p'FooBar[0-9]' {{file}}`
|
||||||
|
|
Loading…
Add table
Reference in a new issue