mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 05:42:09 +02:00
zfgrep: add page (#8708)
This commit is contained in:
parent
6dde355141
commit
86df8a5ee9
1 changed files with 25 additions and 0 deletions
25
pages/common/zfgrep.md
Normal file
25
pages/common/zfgrep.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# zfgrep
|
||||
|
||||
> Matches fixed strings in possibly compressed files.
|
||||
> Equivalent to `grep -F` with input decompressed first if necessary.
|
||||
> More information: <https://manned.org/zfgrep>.
|
||||
|
||||
- Search for an exact string in a file:
|
||||
|
||||
`zfgrep {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Count the number of lines that match the given string in a file:
|
||||
|
||||
`zfgrep --count {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Show the line number in the file along with the matching lines:
|
||||
|
||||
`zfgrep --line-number {{search_string}} {{path/to/file}}`
|
||||
|
||||
- Display all lines except those that contain the search string:
|
||||
|
||||
`zfgrep --invert-match {{search_string}} {{path/to/file}}`
|
||||
|
||||
- List only filenames whose content matches the search string at least once:
|
||||
|
||||
`zfgrep --files-with-matches {{search_string}} {{path/to/file1 path/to/file2 ...}}`
|
Loading…
Add table
Reference in a new issue