Skip to main content

Questions tagged [ripgrep]

ripgrep is a line-oriented search tool that recursively searches your current directory for a regex pattern while respecting your gitignore rules. Also: rg

Filter by
Sorted by
Tagged with
0 votes
1 answer
593 views

Suppose I have a script containing something like VAR=${VAR1%.*} I'm looking for a command along the lines of rg "${.*%" to find it, but I can't get anywhere near. all of these fail rg &...
njamescouk's user avatar
2 votes
1 answer
233 views

I just want to share this, and hoping will get more similar tool. I got a directory of text files.. i need to search for the files with 2 (partial) words in it.. the keywords are in random order, but ...
andrew_ysk's user avatar
0 votes
2 answers
51 views

I have a command like rga --files-with-matches --count-matches --sort path -i -e "use cases?" -e "user stor(y|ies)" -e "Technical debt" -e "Code Quality" -e &...
Ahmad Ismail's user avatar
  • 3,132
2 votes
2 answers
3k views

I'd like to search all git tracked files that 1. has an .hs file extension and 2. contain the word import in any lines. I've tried to use git ls-files -z | xargs -0 rg -g '*.hs' "import" ...
Chris Stryczynski's user avatar
6 votes
1 answer
1k views

What characters match the following regex : ^[a-zA-Z]$ Specifically, should characters with accents (eg. á, è, ò) match this regex? Or just 26 lower and upper case alphabets? I have tried to check ...
adiSuper94's user avatar
1 vote
1 answer
201 views

Probably a rooky question, but I have seen that the "rankmirrors" command can use the stdin input. But when I run the following command (which retrieve all URL in use in the "...
Apitronix's user avatar
  • 113
3 votes
5 answers
2k views

How can I can I find files that contain a specific pattern on a specific line number ? Let's assume I have a directory with a bunch of text files containing 3 lines, such as: Title A Category X ...
Pierre-Jean's user avatar
  • 2,279
1 vote
2 answers
858 views

How to use ripgrep to find adjacent duplicated words. for example one hello hello world How to locate hello hello by using ripgrep? Solved rg '(hello)[[:blank:]]+\1' --pcre2 <<<'one hello ...
jian's user avatar
  • 597
1 vote
2 answers
2k views

I'm on Linux Ubuntu 18.04 and 20.04. Ripgrep (rg) can output a list of paths to files containing matches like this: # search only .txt files rg 'my pattern to match' -g '*.txt' -l # long form rg 'my ...
Gabriel Staples's user avatar
1 vote
1 answer
1k views

I'm new to z shell and ohmyz.sh. I have the following in my zshrc to integrate fzf with rg. This is exactly how it appears in the fzf readme: FZF_BASE=/usr/local/bin DISABLE_FZF_AUTO_COMPLETION="...
StevieD's user avatar
  • 1,123
7 votes
3 answers
3k views

I have a file that contains the some python code. There is a line that contains the following(including the quotes) 'hello "value"' I want to search 'hello "value" in the file. ...
Haris Muzaffar's user avatar
1 vote
4 answers
85 views

Suppose an input.txt file that contains several strings as the following ones: [[foo>a|a]] [[foo>b|b]] [[foo>c|c]] that I'd like to replace by: :foo:`a` :foo:`b` :foo:`c` I guess I could ...
Denis Bitouzé's user avatar
0 votes
2 answers
134 views

I would like to be able to run rg -Ttests instead of typing rg -g'!tests/' -g '!test/' -g'!Tests/' -g '!Test/' , is that possible?
chx's user avatar
  • 880
13 votes
2 answers
7k views

I'd like ripgrep to search paths with the specified pattern. For e.g. rg PATTERN --path REGEX where PATTERN is the pattern to grep and REGEX is the path matching pattern. I have scattered through ...
p0lAris's user avatar
  • 233
36 votes
1 answer
24k views

I've got a list of files that I would like to search for a pattern with ripgrep. How can this be done?
Chris Stryczynski's user avatar
19 votes
1 answer
13k views

Are these related? Which is faster? Can either be limited to directory-names? https://github.com/BurntSushi/ripgrep https://github.com/ggreer/the_silver_searcher
johny why's user avatar
  • 381
79 votes
1 answer
61k views

Using ripgrep (rg), can I print only the filenames which match a given pattern? There are two separate things I'm trying to do: Match the pattern to the pathname itself (like ag -g pattern) Match the ...
Tom Hale's user avatar
  • 33.4k