fd
fd copied to clipboard
Option to only show ignored files
It would be helpful to me to have an option to invert the rule to exclude files in gitignore. Maybe -O and --only-ignore?
For example, my particular use case is that I would like to run fd -O -e json -X rm.
I think this would probably require a change to the upstream ignore crate that fd uses, to support inverting the ignore logic.
I have the following alias in my .gitconfig:
[alias]
lsignored = ls-files . --ignored --exclude-standard --others
# …
and I use the quite often. This could also help with your use case, if you do something like (untested):
git lsignored | grep '\.json$' | xargs rm