4 ms·
Am I the only one who has gone all in on using "-exec +"? find . -name '*.py' -type f -exec grep -il {} +
by linsomniac 2y ago
Am I the only one who has gone all in on using "-exec +"?
find . -name '*.py' -type f -exec grep -il {} +
- usr1106 2y agoThat solves only the second part of their task. The part which they actually had no problem with. But I agree the exec + solution feels better then the xargs -0 solution.
- linsomniac 2y agoAgreed. The first part of that task just seemed to be a misunderstanding of what -print0 is, and using `strings` as the fix is weird. I'm surprised they didn't suggest `tr '\0' '\n'`... :-)
- nicoburns 2y agoI've switched away from find entirely, and now use "fd" whose exec functionality is quite straightforward to use.
- linsomniac 2y agofd looks like a great tool, if you don't have `find` locked in already you probably want to start with `fd` instead. I've already got the basics of `find` in my head so that's the tool I usually reach for rather than switching to `fd`.
- deleted 2y ago[deleted]