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

Option for filtering empty files/directories #273

Closed
clarfonthey opened this issue Mar 30, 2018 · 2 comments · Fixed by #319
Closed

Option for filtering empty files/directories #273

clarfonthey opened this issue Mar 30, 2018 · 2 comments · Fixed by #319

Comments

@clarfonthey
Copy link

This is something that find has that would be very nice to have.

@sharkdp
Copy link
Owner

sharkdp commented Apr 3, 2018

Thank you for your feedback!

In my point of view, searching for empty files/directories is a rather niche use case and I would only consider adding it, if there is a strong support for this (see the part about "80% of the use cases" in the README).

Also, I would like us to think about alternatives to a new --empty command line option. One option could be to extend the --type option with a new "empty" type. Another option could be to use --size 0 (if we decide to move forward with #276).

sharkdp added a commit that referenced this issue Aug 19, 2018
Add a new `empty`/`e` type to search for empty files and/or directories.

To search for both empty files and directories, use one of the
following:

    fd --type empty
    fd -te

    fd --type empty --type file --type directory

To search for empty files, use

    fd --type empty --type file
    fd -te -tf

To search for empty directories, use

    fd --type empty --type directory
    fd -te -td

closes #273
@sharkdp sharkdp added this to the v7.1.0 milestone Aug 19, 2018
@sharkdp
Copy link
Owner

sharkdp commented Aug 19, 2018

Released in v7.1.0, see #319 for details.

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

Successfully merging a pull request may close this issue.

2 participants