mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-06 21:56:58 +00:00
Update cheatsheets
This commit is contained in:
14
tldr/bzgrep
14
tldr/bzgrep
@@ -12,13 +12,13 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`bzgrep "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
|
||||
- Recursively search files in a bzip2 compressed `.tar` archive for a pattern:
|
||||
|
||||
`bzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
|
||||
`bzgrep {{[-r|--recursive]}} "{{search_pattern}}" {{path/to/tar_file}}`
|
||||
|
||||
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
|
||||
|
||||
`bzgrep --{{context|before-context|after-context}} {{3}} "{{search_pattern}}" {{path/to/file}}`
|
||||
`bzgrep {{--context|--before-context|--after-context}} 3 "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Print file name and line number for each match:
|
||||
|
||||
@@ -28,10 +28,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`bzgrep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Recursively search files in a bzip2 compressed `.tar` archive for a pattern:
|
||||
|
||||
`bzgrep {{[-r|--recursive]}} "{{search_pattern}}" {{path/to/tar_file}}`
|
||||
|
||||
- Search `stdin` for lines that do not match a pattern:
|
||||
|
||||
`cat {{path/to/bz_compressed_file}} | bzgrep {{[-v|--invert-match]}} "{{search_pattern}}"`
|
||||
|
||||
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
|
||||
|
||||
`bzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
Reference in New Issue
Block a user