Fd: How to skip network and obscure filesystems?

Created on 28 Jan 2018  路  3Comments  路  Source: sharkdp/fd

I wanted to list files from / with fd 'flac$' / and it retrieves files from network mounts, and things from /proc.

Can those be skipped?
I think that if it's desired to go through those filesystems it should be under some non-default flag, it's a sensible default like using .gitignore to prune the search space.

question

Most helpful comment

Thank you for your feedback.

See #74 for a related discussion (unfortunately, the code is gone). Instead of --mount, we ended up implementing --exclude. I'm open to discuss --mount again, but in the meantime, you can use:

fd -E /proc -E /mnt/network_share 'flac$' /

Unrelated: You can/should use --extension/-e to properly search for .flac files:

fd -e flac

All 3 comments

Thank you for your feedback.

See #74 for a related discussion (unfortunately, the code is gone). Instead of --mount, we ended up implementing --exclude. I'm open to discuss --mount again, but in the meantime, you can use:

fd -E /proc -E /mnt/network_share 'flac$' /

Unrelated: You can/should use --extension/-e to properly search for .flac files:

fd -e flac

Oh, maybe I should've been clearer, I'm not really looking for flac files, but working on a plugin to interactively search for files/directories to edit/cd into.

Probably looking at mount's output is the best general workaround for now. I just wanted to check that there was no single flag solution on fd's side before digging into that.

Maybe it makes sense to have a flag that sets the exclude flags properly, that would avoid adding this probably uncommon filtering into the tight loops.

Also, I noted that there's windows binaries too. I'm not sure how this maps into windows. I think it's still usual to have a single mount drive (or whatever they call C:/ D:/) and no cross mount links (it's even "hard" to create them, I remember there was no GUI), so maybe this is even less important there.

I'll try out setting the exclude flags on the plugin side first, if it goes well I'll comment on what needs to be excluded.

Closing this for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mwgkgk picture mwgkgk  路  3Comments

matu3ba picture matu3ba  路  4Comments

kclevenger picture kclevenger  路  3Comments

mathomp4 picture mathomp4  路  3Comments

carlocab picture carlocab  路  4Comments