find lacks the option -printf, now what?
It's not that Apple removes options, it's that OS X's UNIX underpinnings are mostly derived (circuitously) from FreeBSD, many parts of which can be traced back to the original UNIX... as opposed to the GNU utilities, which are re-implementations with many features added.
In this case, FreeBSD's find(1)
doesn't support -printf
, so I wouldn't expect OS X's to either. Instead, this should work on a BSD-ish system:
find . -print0 | xargs -0 stat -f '%i '
It'll fail on a GNU-userland system, though, where you'd write xargs -0 -r stat -c '%i '
because xargs(1)
and stat(1)
behavior is different.
MAc OS X find binary doesn't support the -printf command. Install brew install findutils
on your mac. This install gfind
with -printf
option.