logoalt Hacker News

ggmyesterday at 9:54 PM3 repliesview on HN

  find -print0 | xargs -0 -I {} "the {} iterated command"

Replies

somatyesterday at 10:48 PM

Xargs is fine, but openbsd has a -J option and every time I read the man page to figure out how to use it I read the -I and -J options and my brain glazes over.

https://man.openbsd.org/xargs

Other brain glazing obsd wierdness is it's two argument cd command, a cryptid I am unable to wrap my head around.

https://man.openbsd.org/ksh#cd~2

show 2 replies
koolbayesterday at 10:06 PM

And for most of those commands add a dash dash so that nothing with a dash prefix turns into options.

show 1 reply
em-beeyesterday at 11:19 PM

why would you ever pipe find into xargs instead of calling -exec?

    find -exec the '{}' iterated command ';'
show 2 replies