Skip to content
Myr

doc: small updates to the FAQ and GUIDE

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Notably, ripgrep can do multiline search now. We also update the supported compression format list and replace deprecated flags like `--sort-files` with `--sort path`.

authored by Andrew Gallant · committed by Andrew Gallant · parent 0df7124 · Browse files · 2 files+10 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−11 removed

  • other:+10 added−11 removed

2 files+10 added−11 removed

modified:FAQ.md+7 added-8 removed
116 unmodified lines
117118The only way to make the order of results consistent is to ask ripgrep to119sort the output. Currently, this will disable all parallelism. (On smaller120repositories, you might not notice much of a performance difference!) You121can achieve this with the `--sort-files` flag.121can achieve this with the `--sort path` flag.122123There is more discussion on this topic here:124https://github.com/BurntSushi/ripgrep/issues/152125
9 unmodified lines
135How do I search compressed files?136</h3>137138ripgrep's `-z/--search-zip` flag will cause it to search compressed files139automatically. Currently, this supports gzip, bzip2, lzma, lz4 and xz only and140requires the corresponding `gzip`, `bzip2` and `xz` binaries to be installed on141your system. (That is, ripgrep does decompression by shelling out to another142process.)139automatically. Currently, this supports gzip, bzip2, xz, lzma, lz4, Brotli and140Zstd. Each of these requires requires the corresponding `gzip`, `bzip2`, `xz`,141`lz4`, `brotli` and `zstd` binaries to be installed on your system. (That is,142ripgrep does decompression by shelling out to another process.)143144ripgrep currently does not search archive formats, so `*.tar.gz` files, for145example, are skipped.146
1 unmodified line
148<h3 name="multiline">149How do I search over multiple lines?150</h3>151152This isn't currently possible. ripgrep is fundamentally a line-oriented search153tool. With that said,154[multiline search is a planned opt-in feature](https://github.com/BurntSushi/ripgrep/issues/176).152The `-U/--multiline` flag enables ripgrep to report results that span over153multiple lines.154155156<h3 name="fancy">157How do I use lookaround and/or backreferences?
826 unmodified lines
modified:GUIDE.md+3 added-3 removed
679 unmodified lines
680* `-c/--count`: Report a count of total matched lines.681* `--files`: Print the files that ripgrep *would* search, but don't actually682 search them.683* `-a/--text`: Search binary files as if they were plain text.684* `-z/--search-zip`: Search compressed files (gzip, bzip2, lzma, xz). This is685 disabled by default.684* `-z/--search-zip`: Search compressed files (gzip, bzip2, lzma, xz, lz4,685 brotli, zstd). This is disabled by default.686* `-C/--context`: Show the lines surrounding a match.687* `--sort-files`: Force ripgrep to sort its output by file name. (This disables687* `--sort path`: Force ripgrep to sort its output by file name. (This disables688 parallelism, so it might be slower.)689* `-L/--follow`: Follow symbolic links while recursively searching.690* `-M/--max-columns`: Limit the length of lines printed by ripgrep.691* `--debug`: Shows ripgrep's debug output. This is useful for understanding
2 unmodified lines