A little beyond the opening question
Sill experimenting, here's a variation on the accepted answer from Daniel:
date && sw_vers && uname -a && touch /Users/Shared/binaries.log && bash
open /Users/Shared/binaries.log && time find ${PATH//:/ } \
/Applications /Developer /Library /System ~/Applications \
-type f -exec lipo -info '{}' ';' 2>/dev/null \
| grep -E "(x86_64|i.86|pent)" | tee /Users/Shared/binaries.log \
| wc -l && exit
It uses a shared area to write the file, with a name ending in .log
, and should open the .log in Console. Also the Terminal window will show the date and time, system version and build — things that I like to keep a note of.
It does not bring the log window to foreground if other windows of Console are open, and does not bring Terminal to foreground at completion.
On some systems the walk may be very time-consuming.
For a faster run
We can use the -perm
primary of find
—
date && sw_vers && uname -a && touch /Users/Shared/binaries.log && bash
open /Users/Shared/binaries.log && time find ${PATH//:/ } \
/Applications /Developer /Library /System ~/Applications \
-perm +111 -type f -exec lipo -info '{}' ';' 2>/dev/null \
| grep -E "(x86_64|i.86|pent)" | tee /Users/Shared/binaries.log \
| wc -l && exit
— but as Daniel commented, this might miss binaries that are only executable for specific users.
2>/dev/null
before the pipe to prevent a ton of crap from being printed.