Preferences

There are many completely unnecessary "reworks" of classic UNIX stdutils that add very little to no value, and instead pitch themselves purely on "written in {lang-the-dev-likes}" or being "blazing fast" or something similar.

`fd` isn't one of those.

`fd` is amazing.

It is simpler, faster and easier to grok than `find`, the commands syntax is a straight up improvement, it comes with sane defaults which makes the easy things and common usecases simple, while the harder ones are way more accessible. It uses colored output in an actually useful way, its manpage is more structured and easier to read...

and MOST IMPORTANTLY

...it is capable of running commands on search results with parallel execution out of the box, so no need to get GNU parallel into the command.

THIS is the kind of renewal of classic command line utilitis we need!

Literally the only pain point for me, is that it doesn't use glob-patterns by default, and that is easily fixed by a handy

    alias gf="fd -g"

This is an honest question, not a criticism, but how much does parallelism help? Isn't the disk a choke point?
Theoretically yes, practically not really (any more). NVMe cards are fast enough that a single core traversing the file system can actually be a chokepoint, so parallelisation helps a lot here.

I also should have made it clear that my comment also wasn't so much about the search (although the parallel search is absolutely a nice-to-have)...it was about the `-x, --exec` being automatically in parallel.

A common usecase is to find all files of X criteria, and then perform the same operation on all of them, e.g. find all session logs older than N days and then compress them, or convert all wav files in a directory tree to mp3

If the operation is computationally expensive, using more than one core speeds things up considerably. With `find`, the way to do that was by piping the output to GNU parallel.

With `fd` I can just use `-x, --exec` and it automatically spins up threads to handle the operations, unless instructed not to.

Depends greatly on the use case. If you're finding all the gifs in a directory and converting them to pngs, it may be the case that CPU is hammered harder than IO. There are surely counterexamples, too.

It's a nice option to have when you need it.

A lot of developer machines are running expensive NVME SSDs, which perform well enough the disk isn't so much of a choke point. If you run on spinning rust, YMMV

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal