News for hackers. Stuff that matters.
Re:An intro to finding things in Linux by lou1306 on Tuesday November 23, 2021 @08:18AM (#29317423)
Personally, I find find(1) to be an utter offender against the Unix philosophy of "doing one thing well". It can do a dozen things or so, and not particularly well either. (Execute actions? Delete stuff? Look for a string within files?). Just look at this post and how long the find(1) section is wrt. the ones about which(1), whereis(1), and locate(1).

I am sure that well-versed users can achieve wonderful things with it; myself, I either use fd or pipe "du -a" into grep (or rg), and move on with my life.

Re:An intro to finding things in Linux by lazyweb on Tuesday November 23, 2021 @09:48AM (#29318390)
Agreed. My most common use case for "finding stuff" on linux boxes is me looking for particular strings in clear text files, so I often end up doing "grep string -Ri {/etc,/var} | less". Also, though find seems to be POSIX compliant, I just don't like it's syntax and how flags are handled.
Re:An intro to finding things in Linux by npteljes on Tuesday November 23, 2021 @10:22AM (#29318823)
For that I like to install ripgrep or `rg` for short, very nice defaults and formats the output nicely too.
Re:An intro to finding things in Linux by hnarn on Tuesday November 23, 2021 @03:44PM (#29323247)
Installing the tools you prefer is not always an option, but I agree, ripgrep is great.
Re:An intro to finding things in Linux by alex_smart on Saturday November 27, 2021 @11:39AM (#29361380)
You can always put some binaries in $HOME/bin.
Re:An intro to finding things in Linux by hnarn on Saturday November 27, 2021 @11:57AM (#29361518)
You cannot "always" do this because some of us frequently or occasionally work in environments where external, non-reviewed software simply isn't allowed.
Re:An intro to finding things in Linux by toxik on Tuesday November 23, 2021 @09:20AM (#29318096)
`fd` seems pretty useful, but I tend to just `find . -name '*whatevs*'`. It's a bit longer, but one less tool to make sure you have available (and find is everywhere), and one less tool to learn. Even just `find . | grep whatevs` is fine.
Re:An intro to finding things in Linux by gpderetta on Tuesday November 23, 2021 @09:28AM (#29318182)
I never bothered to learn all the find options, so find|grep is also my usual goto.
Re:An intro to finding things in Linux by norvvryo on Tuesday November 23, 2021 @09:43AM (#29318334)
POSIX find is a lot less daunting than GNU if you're looking for somewhere to start.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/f...

Re:An intro to finding things in Linux by edgyquant on Tuesday November 23, 2021 @09:51AM (#29318424)
My problem with find -name x is that it’s painfully slow
Re:An intro to finding things in Linux by toxik on Tuesday November 23, 2021 @11:16AM (#29319584)
I think this debate is missing one of my favorites,

locate.