Skip to content

How exclude filetype? #168

Closed Answered by phiresky
patsevanton asked this question in Q&A
Discussion options

You must be logged in to vote

Most parameters work the same as in ripgrep. Just replace rg with rga. Quoting ChatGPT:

To exclude .srt files while using ripgrep, you need to use the --glob flag with the ! operator which stands for "not". Here's an example command:

rg --glob '!*.srt' <pattern>

In the command above, replace <pattern> with the pattern you're searching for. This will search for your pattern in all files except those with the .srt extension.

You can add more file types to be excluded by adding more --glob parameters. For example, to exclude both .srt and .txt files, you can use:

rg --glob '!*.srt' --glob '!*.txt' <pattern>

Remember that the ! operator negates the match, so !*.srt matches anything that is no…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by phiresky
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants