bzegrep, bzfgrep, rgrep, zegrep, zgrep: move from linux to common (#8709)
grep alternatives work substantially the same on all major platforms.
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
# bzegrep
|
||||
|
||||
> Find extended regular expression patterns in bzip2 compressed files using egrep.
|
||||
> More information: <https://manned.org/bzegrep>.
|
||||
|
||||
- Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-sensitive):
|
||||
|
||||
`bzegrep "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-insensitive):
|
||||
|
||||
`bzegrep --ignore-case "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines that do not match a pattern:
|
||||
|
||||
`bzegrep --invert-match "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Print file name and line number for each match:
|
||||
|
||||
`bzegrep --with-filename --line-number "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines matching a pattern, printing only the matched text:
|
||||
|
||||
`bzegrep --only-matching "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Recursively search files in a bzip2 compressed tar archive for a pattern:
|
||||
|
||||
`bzegrep --recursive "{{search_pattern}}" {{path/to/file}}`
|
@@ -1,28 +0,0 @@
|
||||
# bzfgrep
|
||||
|
||||
> Find any fixed strings separated by new lines in bzip2 compressed files using fgrep.
|
||||
> More information: <https://manned.org/bzfgrep>.
|
||||
|
||||
- Search for lines matching the list of search strings separated by new lines in a compressed file (case-sensitive):
|
||||
|
||||
`bzfgrep "{{search_string}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines matching the list of search strings separated by new lines in a compressed file (case-insensitive):
|
||||
|
||||
`bzfgrep --ignore-case "{{search_string}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines that do not match the list of search strings separated by new lines in a compressed file:
|
||||
|
||||
`bzfgrep --invert-match "{{search_string}}" {{path/to/file}}`
|
||||
|
||||
- Print file name and line number for each match:
|
||||
|
||||
`bzfgrep --with-filename --line-number "{{search_string}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines matching a pattern, printing only the matched text:
|
||||
|
||||
`bzfgrep --only-matching "{{search_string}}" {{path/to/file}}`
|
||||
|
||||
- Recursively search files in a bzip2 compressed tar archive for the given list of strings:
|
||||
|
||||
`bzfgrep --recursive "{{search_string}}" {{path/to/file}}`
|
@@ -1,25 +0,0 @@
|
||||
# rgrep
|
||||
|
||||
> Recursively find patterns in files using regular expressions.
|
||||
> Equivalent to `grep -r`.
|
||||
> More information: <https://www.gnu.org/software/grep/manual/grep.html>.
|
||||
|
||||
- Recursively search for a pattern in the current working directory:
|
||||
|
||||
`rgrep "{{search_pattern}}"`
|
||||
|
||||
- Recursively search for a case-insensitive pattern in the current working directory:
|
||||
|
||||
`rgrep --ignore-case "{{search_pattern}}"`
|
||||
|
||||
- Recursively search for an extended regular expression pattern (supports `?`, `+`, `{}`, `()` and `|`) in the current working directory:
|
||||
|
||||
`rgrep --extended-regexp "{{search_pattern}}"`
|
||||
|
||||
- Recursively search for an exact string (disables regular expressions) in the current working directory:
|
||||
|
||||
`rgrep --fixed-strings "{{exact_string}}"`
|
||||
|
||||
- Recursively search for a pattern in a specified directory (or file):
|
||||
|
||||
`rgrep "{{search_pattern}}" {{path/to/file_or_directory}}`
|
@@ -1,28 +0,0 @@
|
||||
# zegrep
|
||||
|
||||
> Find extended regular expression patterns in compressed files using `egrep`.
|
||||
> More information: <https://www.unix.com/man-page/freebsd/1/zegrep/>.
|
||||
|
||||
- Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-sensitive):
|
||||
|
||||
`zegrep "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-insensitive):
|
||||
|
||||
`zegrep --ignore-case "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines that do not match a pattern:
|
||||
|
||||
`zegrep --invert-match "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Print file name and line number for each match:
|
||||
|
||||
`zegrep --with-filename --line-number "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Search for lines matching a pattern, printing only the matched text:
|
||||
|
||||
`zegrep --only-matching "{{search_pattern}}" {{path/to/file}}`
|
||||
|
||||
- Recursively search files in a compressed file for a pattern:
|
||||
|
||||
`zegrep --recursive "{{search_pattern}}" {{path/to/file}}`
|
@@ -1,32 +0,0 @@
|
||||
# zgrep
|
||||
|
||||
> Grep text patterns from files within compressed file (equivalent to grep -Z).
|
||||
> More information: <https://manned.org/zgrep>.
|
||||
|
||||
- Grep a pattern in a compressed file (case-sensitive):
|
||||
|
||||
`zgrep {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Grep a pattern in a compressed file (case-insensitive):
|
||||
|
||||
`zgrep -i {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Output count of lines containing matched pattern in a compressed file:
|
||||
|
||||
`zgrep -c {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Display the lines which don’t have the pattern present (Invert the search function):
|
||||
|
||||
`zgrep -v {{pattern}} {{path/to/compressed/file}}`
|
||||
|
||||
- Grep a compressed file for multiple patterns:
|
||||
|
||||
`zgrep -e "{{pattern_1}}" -e "{{pattern_2}}" {{path/to/compressed/file}}`
|
||||
|
||||
- Use extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`):
|
||||
|
||||
`zgrep -E {{regular_expression}} {{path/to/file}}`
|
||||
|
||||
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
|
||||
|
||||
`zgrep -{{C|B|A}} {{3}} {{pattern}} {{path/to/compressed/file}}`
|
Reference in New Issue
Block a user