-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
Is there a way to ignore certain subdirectories? #721
Comments
Thank you for reporting this. I believe this is related to #374?
If you are okay with multiple invocations, you can simply use this. Admittedly, it's not great:
It would also work if you don't specify the search paths directly:
Obviously, this might include other search results under the current directory that you are not interested in. If there are not too many other folders, you could Another idea would be to place the
|
Thanks for the response. I'm not sure it's really related to #374 as that has more to do with the syntax of ignore files. In this case, I guess I was looking for a flag to do what .fdignore does (wasn't really clear how this worked until I experimented now). There are hundreds of top-level project dirs with thousands of files each. I only care about a few of them, so not specifying search paths is not viable. But having a .fdignore somewhere global that specifies |
I see why you wouldn't want that. An option might be to add |
Thanks for this info. We don't use git, but TIL what this folder does! |
What version of
fd
are you using?8.2.1
I am trying to use fd to list files in some set of directories, but excluding some.
Suppose I want to search in
project1/foo/bar
andproject2/foo/bar
, which have lots of subdirectories. I want to ignore everything underproject1/foo/bar/baz
, but do want to include everything inproject2/foo/bar/baz
.This doesn't seem to work:
fd --exclude "project1/foo/bar/baz" . project1/foo/bar project2/foo/bar
Nothing gets filtered.
If I do:
fd --exclude "baz" . project1/foo/bar project2/foo/bar
this correctly excludes
baz
underproject1/foo/bar
, but also incorrectly excludes the one underproject2/foo/bar
.Is there a way to accomplish this? Preferably with one command, though I am OK with multiples invocations if needed.
Thanks.
The text was updated successfully, but these errors were encountered: