fd icon indicating copy to clipboard operation
fd copied to clipboard

[Feature request] Support "-links" option from find

Open maaaaz opened this issue 1 month ago • 2 comments

Hello there,

Thanks for your great tool. Could consider adding the -links options of find to fd ?

-links n
          File has less than, more than or exactly n hard links.

It is really useful for certain cases, such as listing only leaf folders.

Cheers!

maaaaz avatar Nov 22 '25 20:11 maaaaz

Are there any other use cases?

As a user, I think it would be more useful to have an option to filter to leaf directories, than have a -links option that requires the user to know that the "hard link count" for a directory is 2 + the number of subdirectories.

And for the case of "leaf directories" I think the most consistent API would be to add a leafdir type to the --type argument.

tmccombs avatar Nov 23 '25 07:11 tmccombs

I don't have other use cases in my mind, but ok for a leafdir type !

maaaaz avatar Nov 23 '25 11:11 maaaaz