Title: Theory / Unimportant / CS / command line / text streaming / ripgrep
On every note of this deck, unless a note says otherwise:
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md

Name: ripgrep
Definition: A fast command line powerful search tool

Instruction: rg pattern path
Page: https://github.com/BurntSushi/ripgrep
Language: sh
Returns: Show the occurrences of pattern in files matching path and the content of the directories matching path

Instruction: rg pattern
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Language: sh
Returns: similar as
rg pattern ./

Fla: -F
Effect: interpret the argument as a literal instead of a pattern
Prefix: rg

Question: What files are ignored by default
Answer: gitignore, .ignore, .rgignore
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Context: rg
Answer2: hidden files and directories
Answer3: binary files (any file with a NUL byte)
Answer4: symbolic links

Fla: --no-ignore
Effect: Search all files, even the one normally ignored
Prefix: rg

Fla: --hidden
Effect: search hidden files and directories
Prefix: rg

Fla: --text
Effect: search in binary files
Prefix: rg
Flag abbreviation: -a

Fla: --follow
Effect: search in symlinks
Prefix: rg
Flag abbreviation: -L

Fla: --unrestricted
Effect: Each occurrence of this flag add more files to the search (e.g. --no-ignore, --hiden--text, --follow)
Prefix: rg
Flag abbreviation: -u
Intuition: Allow to broaden a search if the first one failed

Variable: .rgignore
Meaning: pattern of files not to search
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Context: rg

Instruction: !foo
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Effect: whitelist foo even if a lower precedence file blacklisted
Context: rg ignore file

Fla: -g 'pattern'
Effect: Limit to files whose name matches pattern
Prefix: rg

Fla: -g '!pattern'
Effect: Limit to files whose name do not match pattern
Prefix: rg

Fla: --type type
Effect: Limit search to files of type type
Prefix: rg
Flag abbreviation: -ttype

Fla: --type-not type
Effect: Limit search to files whose type is not type
Prefix: rg
Flag abbreviation: -Ttype

Fla: --type-list
Effect: print the definition of all types known by ripgrep
Prefix: rg

Fla: --type-add 'type_name:pattern'
Effect: In this usage only, add a type named type_name, which match pattern pattern
Prefix: rg

Variable: all
Meaning: the union of all types known to ripgrep
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Context: rg type
Language: sh

Fla: --replace foo
Effect: Replace the matched pattern by foo in the output
Prefix: rg pattern
Flag abbreviation: -r foo

Fla: --only-matching
Effect: print only the part of the line that matches the input
Prefix: rg pattern
Flag abbreviation: -o

Instruction: $0
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Effect: The part of text matched by the whole pattern
Language: sh
Context: rg replace

Instruction: $i
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Effect: The part of text matched by the i-th capturing part
Language: sh
Context: rg replace

Instruction: $name
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Effect: The part of text matched by the capturing group named word
Language: sh
Context: rg replace

Variable: .ripgreprc
Meaning: default rg's flags
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md

Fla: --debug
Prefix: ripgrep
Print: print debug help

Fla: --no-config
Effect: Don't read config file
Prefix: ripgrep

Fla: --encoding none
Effect: Search for raw bytes, don't consider character encoding
Prefix: ripgrep
Flag abbreviation: -E none

Fla: --encoding auto
Effect: let ripgrep guess the encoding of files
Prefix: ripgrep
Flag abbreviation: -E auto
Default: rg

Name: preprocessor
Definition: any type of command that can be run to transform the input of every file before ripgrep searches it
Page: https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md
Context: ripgrep

Fla: --pre preprocessor
Effect: apply preprocessor to the files and search in its output
Prefix: rg pattern

Fla: --pre-glob pattern
Effect: apply the preprocessor only if file name match pattern
Prefix: rg pattern --pre preprocessor

Fla: -h
Prefix: rg
Print: condensed help

Fla: --help
Prefix: rg
Print: long form help

Fla: --ignore-case
Effect: ignore case in searched pattern
Prefix: rg
Flag abbreviation: -i

Fla: --smart-case
Effect: if the pattern is in lower case, then ignore case in search
Prefix: rg
Flag abbreviation: -S

Fla: --word-regexp
Effect: search the pattern as a word, not as a subword
Prefix: rg
Flag abbreviation: -W

Fla: --count
Effect: report a count of total matched lines
Prefix: rg
Flag abbreviation: -c

Fla: --files
Effect: Print the files that ripgrep would search
Prefix: rg

Fla: --multiline
Effect: Permit matches to span multiple line
Prefix: rg
Flag abbreviation: -U

Fla: --search-zip
Effect: search in compressed files
Prefix: rg
Flag abbreviation: -z

Fla: --context
Prefix: rg
Flag abbreviation: -C
Print: lines surrounding a match

Fla: --sort path
Effect: Sort its output by file name
Prefix: rg
Assuming: slower, because it removes parallelism

Fla: --pcre2
Effect: uses prce2 regex engine
Page: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#posix4ever
Prefix: rg
Flag abbreviation: -P