Skip to content
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

[FEATURE] Filtering by extension/pattern? #22

Open
polarathene opened this issue May 29, 2019 · 4 comments
Open

[FEATURE] Filtering by extension/pattern? #22

polarathene opened this issue May 29, 2019 · 4 comments

Comments

@polarathene
Copy link

I see there is the -x option, but no example.

-x, --exclude NAME exclude matching files or directories

It only accepts full filename? Would it be possible to support matching a filter pattern? -p --pattern PATTERN Where you can use a pattern for filtering the results via globs, include/exclude extensions *.webp,*.jpg(only match these), or exclude *.gif,preview*.

In my case, I just wanted to identify results with a certain file extension, doesn't seem possible currently?

Thanks for the great tool, it's been helpful, using some native system commands on a server wasn't working in large directories, either raising an error that the arg list was too long, or being unresponsive for a long time with no feedback. dutree handled these directories like a champ! :)

@nachoparker
Copy link
Owner

hi, at the moment this is simply a literal string comparison, but it could be extended easily to use globbing or regex.

PRs are welcome for this

@polarathene
Copy link
Author

The README/help text aren't clear on the --exclude option. How do you exclude multiple?

eg --exclude="filedir_a filedir_b filedir_c"? Delimiting by space and comma seems to have no effect

@nachoparker
Copy link
Owner

You can use -x file1 -x file2

@polarathene
Copy link
Author

Hello from Aug 2021 :)

I was searching for this functionality again, even just to filter/search by a single file extension at a time. Looking through various tools again for this and this feature remains rare to find, at best it is usually exclude only. So I need to resort to using traditional linux commands like find and awk in a script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants