g is used, then ripgrep will only quit when it sees a \fBNUL\fP byte after it sees a match (or searches the entire file). .sp This flag overrides the \flag{binary} flag. threadsSet the approximate number of threads to use. This flag sets the approximate number of threads to use. A value of \fB0\fP (which is the default) causes ripgrep to choose the thread count using heuristics. traceShow trace messages. Show trace messages. This shows even more detail than the \flag{debug} flag. Generally, one should only use this if \flag{debug} doesn't emit the information you're looking for. trimno-trimTrim prefix whitespace from matches. When set, all ASCII whitespace at the beginning of each line printed will be removed. typeTYPEOnly search files matching TYPE. This flag limits ripgrep to searching files matching \fITYPE\fP. Multiple \flag{type} flags may be provided. .sp This flag supports the special value \fBall\fP, which will behave as if \flag{type} was provided for every file type supported by ripgrep (including any custom file types). The end result is that \fB\-\-type=all\fP causes ripgrep to search in "whitelist" mode, where it will only search files it recognizes via its type definitions. .sp Note that this flag has lower precedence than both the \flag{glob} flag and any rules found in ignore files. .sp To see the list of available file types, use the \flag{type-list} flag. type-addTYPESPECAdd a new glob for a file type. This flag adds a new glob for a particular file type. Only one glob can be added at a time. Multiple \flag{type-add} flags can be provided. Unless \flag{type-clear} is used, globs are added to any existing globs defined inside of ripgrep. .sp Note that this must be passed to every invocation of ripgrep. Type settings are not persisted. See \fBCONFIGURATION FILES\fP for a workaround. .sp Example: .sp .EX rg \-\-type\-add 'foo:*.foo' -tfoo \fIPATTERN\fP .EE .sp This flag can also be used to include rules from other types with the special include directive. The include directive permits specifying one or more other type names (separated by a comma) that have been defined and its rules will automatically be imported into the type specified. For example, to create a type called src that matches C++, Python and Markdown files, one can use: .sp .EX \-\-type\-add 'src:include:cpp,py,md' .EE .sp Additional glob rules can still be added to the src type by using this flag again: .sp .EX \-\-type\-add 'src:include:cpp,py,md' \-\-type\-add 'src:*.foo' .EE .sp Note that type names must consist only of Unicode letters or numbers. Punctuation characters are not allowed. type-clearClear globs for a file type. Clear the file type globs previously defined for \fITYPE\fP. This clears any previously defined globs for the \fITYPE\fP, but globs can be added after this flag. .sp Note that this must be passed to every invocation of ripgrep. Type settings are not persisted. See \fBCONFIGURATION FILES\fP for a workaround. type-notDo not search files matching TYPE. Do not search files matching \fITYPE\fP. Multiple \flag{type-not} flags may be provided. Use the \flag{type-list} flag to list all available types. .sp This flag supports the special value \fBall\fP, which will behave as if \flag{type-not} was provided for every file type supported by ripgrep (including any custom file types). The end result is that \fB\-\-type\-not=all\fP causes ripgrep to search in "blacklist" mode, where it will only search files that are unrecognized by its type definitions. .sp To see the list of available file types, use the \flag{type-list} flag. type-listShow all supported file types. Show all supported file types and their corresponding globs. This takes any \flag{type-add} and \flag{type-clear} flags given into account. Each type is printed on its own line, followed by a \fB:\fP and then a comma-delimited list of globs for that type on the same line. unrestrictedReduce the level of "smart" filtering. This flag reduces the level of "smart" filtering. Repeated uses (up to 3) reduces the filtering even more. When repeated three times, ripgrep will search every file in a directory tree. .sp A single \flag{unrestricted} flag is equivalent to \flag{no-ignore}. Two \flag{unrestricted} flags is equivalent to \flag{no-ignore} \flag{hidden}. Three \flag{unrestricted} flags is equivalent to \flag{no-ignore} \flag{hidden} \flag{binary}. .sp The only filtering ripgrep still does when \fB-uuu\fP is given is to skip symbolic links and to avoid printing matches from binary files. Symbolic links can be followed via the \flag{follow} flag, and binary files can be treated as text files via the \flag{text} flag. versionPrint ripgrep's version. This flag prints ripgrep's version. This also may print other relevant information, such as the presence of target specific optimizations and the \fBgit\fP revision that this build of ripgrep was compiled from. vimgrepPrint results in a vim compatible format. This flag instructs ripgrep to print results with every match on its own line, including line numbers and column numbers. .sp With this option, a line with more than one match will be printed in its entirety more than once. For that reason, the total amount of output as a result of this flag can be quadratic in the size of the input. For example, if the pattern matches every byte in an input file, then each line will be repeated for every byte matched. For this reason, users should only use this flag when there is no other choice. Editor integrations should prefer some other way of reading results from ripgrep, such as via the \flag{json} flag. One alternative to avoiding exorbitant memory usage is to force ripgrep into single threaded mode with the \flag{threads} flag. Note though that this will not impact the total size of the output, just the heap memory that ripgrep will use. with-filenamePrint the file path with each matching line. This flag instructs ripgrep to print the file path for each matching line. This is the default when more than one file is searched. If \flag{heading} is enabled (the default when printing to a tty), the file path will be shown above clusters of matches from each file; otherwise, the file name will be shown as a prefix for each matched line. .sp This flag overrides \flag{no-filename}. no-filenameNever print the path with each matching line. This flag instructs ripgrep to never print the file path with each matching line. This is the default when ripgrep is explicitly instructed to search one file or stdin. .sp This flag overrides \flag{with-filename}. word-regexpShow matches surrounded by word boundaries. When enabled, ripgrep will only show matches surrounded by word boundaries. This is equivalent to surrounding every pattern with \fB\\b{start-half}\fP and \fB\\b{end-half}\fP. .sp This overrides the \flag{line-regexp} flag.