Fd: How to find JSON files in `.something` directories?

Created on 22 Jan 2020  路  2Comments  路  Source: sharkdp/fd

I'm trying something like this:

fd -H --extension json '' '.*'

But it leads to [fd error]: '.*' is not a directory.. I am aware of --search-paths and also tried -p ... but can't get it working.

I guess another way to ask is how to use globs for directories / paths.

question

Most helpful comment

Don't quote the .*. What you have is searching in the literal directory .* Instead of doing shell expansion.

All 2 comments

Don't quote the .*. What you have is searching in the literal directory .* Instead of doing shell expansion.

@tmccombs Thanks, and the actual glob should be .*/ so that only directories are included (without the trailing slash, also files will be listed, leading to errors like [fd error]: '.xyz' is not a directory).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathomp4 picture mathomp4  路  3Comments

sharkdp picture sharkdp  路  4Comments

kclevenger picture kclevenger  路  3Comments

blueray453 picture blueray453  路  3Comments

codyro picture codyro  路  4Comments