1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-23 03:55:25 +02:00

*grep*, btrfs*: add option placeholders (#16438)

This commit is contained in:
Managor 2025-05-11 20:03:52 +03:00 committed by GitHub
parent 48e6bfe1bc
commit 062980cd27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 50 additions and 50 deletions

View file

@ -9,20 +9,20 @@
- Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-insensitive):
`bzegrep --ignore-case "{{search_pattern}}" {{path/to/file}}`
`bzegrep {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
- Search for lines that do not match a pattern:
`bzegrep --invert-match "{{search_pattern}}" {{path/to/file}}`
`bzegrep {{[-v|--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}}`
`bzegrep {{[-H|--with-filename]}} {{[-n|--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}}`
`bzegrep {{[-o|--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}}`
`bzegrep {{[-r|--recursive]}} "{{search_pattern}}" {{path/to/file}}`

View file

@ -9,20 +9,20 @@
- 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}}`
`bzfgrep {{[-i|--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}}`
`bzfgrep {{[-v|--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}}`
`bzfgrep {{[-H|--with-filename]}} {{[-n|--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}}`
`bzfgrep {{[-o|--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}}`
`bzfgrep {{[-r|--recursive]}} "{{search_string}}" {{path/to/file}}`

View file

@ -9,24 +9,24 @@
- Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
`bzgrep --extended-regexp --ignore-case "{{search_pattern}}" {{path/to/file}}`
`bzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
- Print 3 lines of context around, before, or after each match:
- 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:
`bzgrep --with-filename --line-number "{{search_pattern}}" {{path/to/file}}`
`bzgrep {{[-H|--with-filename]}} {{[-n|--line-number]}} "{{search_pattern}}" {{path/to/file}}`
- Search for lines matching a pattern, printing only the matched text:
`bzgrep --only-matching "{{search_pattern}}" {{path/to/file}}`
`bzgrep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`
- Recursively search files in a bzip2 compressed tar archive for a pattern:
`bzgrep --recursive "{{search_pattern}}" {{path/to/tar/file}}`
`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 --invert-match "{{search_pattern}}"`
`cat {{/path/to/bz/compressed/file}} | bzgrep {{[-v|--invert-match]}} "{{search_pattern}}"`

View file

@ -9,8 +9,8 @@
- Extract to the current directory using the basename of the file from the archive:
`ptargrep --basename "{{search_pattern}}" {{path/to/file}}`
`ptargrep {{[-b|--basename]}} "{{search_pattern}}" {{path/to/file}}`
- Search for a case-insensitive pattern matching within a tar archive:
`ptargrep --ignore-case "{{search_pattern}}" {{path/to/file}}`
`ptargrep {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`

View file

@ -5,7 +5,7 @@
- Start a query TUI to search files in the current directory recursively (`<Ctrl z>` for help):
`ugrep --query`
`ugrep {{[-Q|--query]}}`
- Search the current directory recursively for files containing a regex search pattern:
@ -13,24 +13,24 @@
- Search in a specific file or in all files in a specific directory, showing line numbers of matches:
`ugrep --line-number "{{search_pattern}}" {{path/to/file_or_directory}}`
`ugrep {{[-n|--line-number]}} "{{search_pattern}}" {{path/to/file_or_directory}}`
- Search in all files in the current directory recursively and print the name of each matching file:
`ugrep --files-with-matches "{{search_pattern}}"`
`ugrep {{[-l|--files-with-matches]}} "{{search_pattern}}"`
- Fuzzy search files with up to 3 extra, missing or mismatching characters in the pattern:
`ugrep --fuzzy={{3}} "{{search_pattern}}"`
`ugrep {{[-Z|--fuzzy=]}}{{3}} "{{search_pattern}}"`
- Also search compressed files, Zip and tar archives recursively:
`ugrep --decompress "{{search_pattern}}"`
`ugrep {{[-z|--decompress]}} "{{search_pattern}}"`
- Search only files whose filenames match a specific glob pattern:
`ugrep --glob="{{glob_pattern}}" "{{search_pattern}}"`
`ugrep {{[-g |--glob=]}}"{{glob_pattern}}" "{{search_pattern}}"`
- Search only C++ source files (use `--file-type=list` to list all file types):
`ugrep --file-type=cpp "{{search_pattern}}"`
`ugrep {{[-t |--file-type=]}}cpp "{{search_pattern}}"`

View file

@ -2,7 +2,7 @@
> A user friendly pager for grep.
> See also: `ugrep`, `rg`.
> More information: <https://github.com/vrothberg/vgrep>.
> More information: <https://github.com/vrothberg/vgrep/blob/main/docs/vgrep.1.md>.
- Recursively search the current directory for a pattern and cache it:
@ -14,20 +14,20 @@
- Open the "4th" match from the cache in the default editor:
`vgrep --show {{4}}`
`vgrep {{[-s|--show]}} {{4}}`
- Display a context of "3" lines for each match in the cache:
`vgrep --show=context{{3}}`
`vgrep {{[-s|--show]}} {{[c|context]}}{{3}}`
- Display the number of matches for each directory in the tree:
`vgrep --show=tree`
`vgrep {{[-s|--show]}} {{[t|tree]}}`
- Display the number of matches for each file in the tree:
`vgrep --show=files`
`vgrep {{[-s|--show]}} {{[f|files]}}`
- Start an interactive shell with cached matches:
`vgrep --interactive`
`vgrep {{[-i|--interactive]}}`

View file

@ -10,24 +10,24 @@
- Search for an exact string (disables regular expressions):
`xzgrep --fixed-strings "{{exact_string}}" {{path/to/file}}`
`xzgrep {{[-F|--fixed-strings]}} "{{exact_string}}" {{path/to/file}}`
- Search for a pattern in all files showing line numbers of matches:
`xzgrep --line-number "{{search_pattern}}" {{path/to/file}}`
`xzgrep {{[-n|--line-number]}} "{{search_pattern}}" {{path/to/file}}`
- Use extended regular expressions (supports `?`, `+`, `{}`, `()` and `|`), in case-insensitive mode:
`xzgrep --extended-regexp --ignore-case "{{search_pattern}}" {{path/to/file}}`
`xzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
- Print 3 lines of context around, before, or after each match:
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`xzgrep --{{context|before-context|after-context}}={{3}} "{{search_pattern}}" {{path/to/file}}`
`xzgrep --{{context|before-context|after-context}} {{3}} "{{search_pattern}}" {{path/to/file}}`
- Print file name and line number for each match with color output:
`xzgrep --with-filename --line-number --color=always "{{search_pattern}}" {{path/to/file}}`
`xzgrep {{[-H|--with-filename]}} {{[-n|--line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}`
- Search for lines matching a pattern, printing only the matched text:
`xzgrep --only-matching "{{search_pattern}}" {{path/to/file}}`
`xzgrep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`

View file

@ -9,20 +9,20 @@
- Search for extended regular expressions (supporting `?`, `+`, `{}`, `()` and `|`) in a compressed file (case-insensitive):
`zegrep --ignore-case "{{search_pattern}}" {{path/to/file}}`
`zegrep {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
- Search for lines that do not match a pattern:
`zegrep --invert-match "{{search_pattern}}" {{path/to/file}}`
`zegrep {{[-v|--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}}`
`zegrep {{[-H|--with-filename]}} {{[-n|--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}}`
`zegrep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`
- Recursively search files in a compressed file for a pattern:
`zegrep --recursive "{{search_pattern}}" {{path/to/file}}`
`zegrep {{[-r|--recursive]}} "{{search_pattern}}" {{path/to/file}}`

View file

@ -13,7 +13,7 @@
- Show the progress of the check:
`sudo btrfs check --progress {{path/to/partition}}`
`sudo btrfs check {{[-p|--progress]}} {{path/to/partition}}`
- Verify the checksum of each data block (if the filesystem is good):
@ -21,7 +21,7 @@
- Use the `n`-th superblock (`n` can be 0, 1 or 2):
`sudo btrfs check --super {{n}} {{path/to/partition}}`
`sudo btrfs check {{[-s|--super]}} {{n}} {{path/to/partition}}`
- Rebuild the checksum tree:

View file

@ -5,11 +5,11 @@
- Add one or more devices to a btrfs filesystem:
`sudo btrfs device add {{path/to/block_device1}} [{{path/to/block_device2}}] {{path/to/btrfs_filesystem}}`
`sudo btrfs device add {{path/to/block_device1 path/to/block_device2 ...}} {{path/to/btrfs_filesystem}}`
- Remove a device from a btrfs filesystem:
`sudo btrfs device remove {{path/to/device|device_id}} [{{...}}]`
`sudo btrfs device remove {{path/to/device1|device_id1 path/to/device2|device_id2 ...}}`
- Display error statistics:
@ -17,7 +17,7 @@
- Scan all disks and inform the kernel of all detected btrfs filesystems:
`sudo btrfs device scan --all-devices`
`sudo btrfs device scan {{[-d|--all-devices]}}`
- Display detailed per-disk allocation statistics:

View file

@ -9,7 +9,7 @@
- Print superblock's and all of its copies' information:
`sudo btrfs inspect-internal dump-super --all {{path/to/partition}}`
`sudo btrfs inspect-internal dump-super {{[-a|--all]}} {{path/to/partition}}`
- Print filesystem's metadata information: