What does HackerNews think of fd?

A simple, fast and user-friendly alternative to 'find'

Language: Rust

#29 in Hacktoberfest
#15 in Rust
#6 in Terminal
AFAIK there is a find replacement with sane defaults: https://github.com/sharkdp/fd , a lot of people I know love it.

However, I already have this in my muscle memory: find -name '' -type f(file)/d(directory)

Works in 90% of situations when searching for some file in terminal, ie: find / -name 'stuff*'

The rest of the time is spent figuring out exec/xargs. :)

And once you master that, swap xargs for GNU parallel. I bet your machine has a ton of cores, don't let then sit idly. ;)

> without zsh globs I have to remember find syntax

My "solution" to this is using https://github.com/sharkdp/fd (even when in zsh and having glob support). I'm not sure if using a tool that's not present by default would be suitable for your use cases, but if you're considering alternate shells, I suspect you might be

Nice to see other alternatives to find. I personally use fd (https://github.com/sharkdp/fd) a lot, as I find the UX much better. There is one thing that I think could be better, around the difference between "wanting to list all files that follow a certain pattern" and "wanting to find one or a few specific files". Technically, those are the same, but an issue I'll often run into is wanting to search something in dotfiles (for example the Go tools), use the unrestricted mode, and it'll find the few files I'm looking for, alongside hundreds of files coming from some cache/backup directory somewhere. This happens even more with rg, as it'll look through the files contents.

I'm not sure if this is me not using the tool how I should, me not using Linux how I should, me using the wrong tool for this job, something missing from the tool or something else entirely. I wonder if other people have this similar "double usage issue", and I'm interested in ways to avoid it.

fd instead of find (fast, good defaults) https://github.com/sharkdp/fd
> Three months is a _very_ long time in software

No, its not. For example, I use an open source app called fd:

https://github.com/sharkdp/fd

I have not updated it since 2020. Yeah, new versions are available, but the old one works fine, so no need to even upgrade. You shouldn't have to get every single version of software just because its available.

It's amusing to me that basic functionality like searching for a file is a $6 app on MacOS (the link within the article is https://apps.tempel.org/FindAnyFile/) while fd-find exists (https://github.com/sharkdp/fd) on all major platforms and is free, open source, and easy to use if you have eyes and can read a few basic instructions.
> If you're going to do that, would you not be better saving all that time and code bloat (it's code you wrote that doesn't contribute to solving your problem) by just using a garbage collector from the outset?

I suspect a garbage collector would be pretty nice. However, I can't just list the features I want and get a language (unless I make it myself, which would take a lot of time). Currently, my imaginary perfect language would actually have a garbage collector, would be pretty similar to Standard ML, but would be more focused on arrays than lists, and would have value types --- in Standard ML I can't have a value array of records (structs in Rust/C++ parlance) --- they will be behind a pointer. And if I were to stick to the standard or make sure that my code compiles with other compilers than MLTon, then I can't even have a value array of 64-bit words, although I can have a value array of 63-bit words. This one bit may seem insignificant, but for certain algorithms it's a big complication. Powers of 2 simplify a lot of algorithms (and are "faster" to be a bit loose with the language). There are other features I'd like, but already this short list makes for a currently-non-existent language. OCaml and Haskell have similar problems to Standard ML.

At the same time Rust has great support for arrays, is expression-oriented, has sum types. Value types are the default. It generally ticks a lot of boxes I care about. I can't just go and say "now give me all that but with a GC" and have it appear before me.

Also, arenas I use are linked to logical portions of my programs. They are not contrivances that I had to think long and hard about. They don't waste my time really. I've spent 0 time thinking about how they should be organized.

Now the part where a GC would be helpful is a bit of a more liberal use of closures, and eliminating code noise coming from lifetime annotations such as "for<'a>". But I can live with the current state of affairs, if I get all the other benefits.

> If you're going to do that, would you not be better saving all that time and code bloat (it's code you wrote that doesn't contribute to solving your problem) by just using a garbage collector from the outset?

If anything, Rust is an asset for large teams of devs. Even though you may sometimes argue that a handful of C/C++ devs can keep their whole project in their heads and not make mistakes (although I think that's a stretch), the moment you get a large C/C++ team, weird hard-to-debug bugs coming from memory- and thread-safety issues start to creep in. There are other high-level languages, but Rust is the one with a combination of performance competitive with C++ and large ecosystem of libraries you can use. Examples of Rust projects with a large number of contributors facilitated by the language taking the fear of intractable bugs away:

- <https://github.com/BurntSushi/ripgrep>

- <https://github.com/clap-rs/clap>

- <https://github.com/rayon-rs/rayon>

- <https://github.com/cloudflare/wrangler>

- <https://github.com/sharkdp/fd>

Would be interested if the final one-liner would be faster if updated to use the rust equivalent utils like https://github.com/ezrosent/frawk and https://github.com/sharkdp/fd
find or indeed, the Rust-based fd[1] which is infinitesimally faster.

[1]https://github.com/sharkdp/fd

I’ve almost entirely stopped using find and switched to fd, very simple options.. works pretty well for my purposes. https://github.com/sharkdp/fd
https://wiki.archlinux.org/title/fish#Setting_fish_as_intera... you can use it as an interactive shell in bash as well. Fzf can also use Rusty fd. ;) https://github.com/sharkdp/fd
This is what I use:

https://github.com/sharkdp/fd

Which you can install as a binary, or via cargo. fd is spectacular.

To that you can add: https://github.com/junegunn/fzf

Which you can bind to a key in your shell for convenience.

Upstream says Ubuntu's package is 'fd-find' (and the executable is 'fdfind' -- both renamed from upstream's 'fd' because of a name collision with an unrelated Debian package. If you don't care about that one, you can safely alias fd="fdfind").

https://github.com/sharkdp/fd

(I've edited my first comment in response to this reply: I originally wrote "fdfind". (For a comment about regexp tools, this is a uniquely, hilariously stupid oversight. Sorry!)).