New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ripgrep no way to exclude directory e.g. Tests and search for all *.c files #839
Comments
Please fill out the entire issue template. That's why it is there to guide you, because the request you've made is insufficient to act on. In particular, I have no idea what you are asking for. Please also make sure you've read the documentation. ripgrep can of course exclude directories. |
@sumonto you're correct
|
It's not possible to act on this issue. Closing. |
I might know what the issue might be: ZSH I was trying to make this work in ZSH:
The command was suppose to only search in specific file types (in this case
the
|
You can also just use single-quotes instead of double- (which is what the OP was doing, so i don't think it was the issue there). Or you can turn off history expansion, but you lose some functionality obv |
I found out that which previously looked like this |
@BobrImperator, use |
Hello everyone. How do you exclude multiple directories? Currently, I am using --glob multiple times like this: rg --hidden -g '!.git' -g '!.svn' -g '!.hg' -g '!CVS' -g '!.bzr' -g '!vendor' -g '!node_modules' -g '!dist' -g '!bin' |
@joeky888 Why are you bumping old issues? Use Discussions to ask questions next time please. In any case, you can use |
@BurntSushi Thanks for the solution, it works! |
Apologies for necrobumping, but to emphasize the |
@dharmaturtle Thank you!! |
What version of ripgrep are you using?
ripgrep 0.7.1
-AVX -SIMD
What operating system are you using ripgrep on?
Mac High Sierra
Describe your question, feature request, or bug.
Imagine a folder structure like:
Feature
codefiles1 (contains *.c, *.h)
codefiles2 (contains *.c, *.h)
tests (contains *.c, *.h)
I would like to search a string str1 in *.c, *.h files however exclude/ignore all occurrences in "tests" folder
I would assume the below syntax would do it?
rg -w str1 -tc -g '!tests/*'
If a feature request, please describe the behavior you want and the motivation.
Please also provide an example of how ripgrep would be used if your feature
request were added.
If a bug, please see below.
If this is a bug, what are the steps to reproduce the behavior?
NA
If this is a bug, what is the actual behavior?
NA
If this is a bug, what is the expected behavior?
ripgrep should have excluded files from "tests" folder
The text was updated successfully, but these errors were encountered: