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 on a same line.
So far, i can use this:
$ rg -i '\w*keyword1\w*.*\w*keyword2\w*|\w*keyword2\w*.*\w*keyword1\w*' --glob '*.txt' --line-number -l /path/to/search $ rg -g '*.txt' -l -i 'keyword1.*keyword2|keyword2.*keyword1' /path/to/search Both of these can do the same job.
Anybody have other that can do the same job ? Pls do share. I found myself need this quite often to locate the proper file..
However i don't know how to search file that filename is 2 keywords that are not in order. How about searching for filename with 2 keyword that is not in order ? Example: weirdfilename_key1Nkey3Nkey2etc.txt search among huge database for file with which name only remember consist of "key2" and "key3" in it, but not sure the order..