SCANMACHO(1)
π SCANMACHO(1) β the manual page, but make it cute
okay so first things first bestie, this is part of the pax-utils docs, and the command is literally called scanmacho β¨
πΈ NAME πΈ
scanmacho β a user-space utility that scans Mach-O files π
π SYNOPSIS π
scanmacho [options] Mach-Os or directories
π DESCRIPTION π
scanmacho is a user-space utility that will quickly scan whatever Mach-Os you hand it β or directories, or the common system paths β and pull out different kinds of info. We're talking Mach-O types, their install_names, all that good stuff. literally so handy π«Ά
And here's the thing, because Mach-O files can be "fat" π, a single file can totally return multiple lines. Each line = one single architecture contained inside that fat (universal) file. There aren't any real restrictions on this, but in practice you can tell the entries apart by their arch type, like ppc, ppc64, i386, x86_64, arm, ... iykyk π
β¨ OPTIONS β¨
-A,--archivesβ scan archives (.afiles) π¦-a,--allβ print all the useful/simple info, the whole vibe check-B,--nobannerβ don't display the header, we're skipping the intro-b,--bindβ print the flags frommach_header-D,--endianβ print the Mach-O endianness-E,--etypefiletype β only print Mach-O files that match the etype you specified (likeMH_EXECUTABLE,MH_DYLIB, etc...)-F,--formatFORMAT β use your specified format for output; peep the FORMAT section below for the deets π-f,--fromFILE β read the input stream from the filename you specified-g,--gmatchβ usestrncmpto match libraries (use with-N). Or regexp with symbol matching-h,--helpβ show condensed usage and dip-i,--interpβ print the interpreter information (LC_LOAD_DYLINKER)-M,--bitsBITS β only print Mach-O files matching the numeric bits you gave (like32/64)-m,--mountβ don't recursively cross mount points, we stay in our lane-N,--libINSTALLNAME β find the Mach-Os that need theINSTALL_NAMEyou specified-n,--neededβ print the libraries the Mach-O is linked against (LC_LOAD_DYLIB). bestie reveal π-O,--permsPERMS β only print Mach-O files with matching specified octal bits (like755)-o,--fileFILE β write the output stream to the filename you specified-p,--pathβ scan all the directories in thePATHenvironment-q,--quietβ only output the 'bad' things. no fluff, only drama π-R,--recursiveβ scan directories recursively, go deep-r,--rpathβ print the RPATH encoded in the Mach-O (LC_RPATH)-S,--sonameβ print the Mach-O's shared library name (install_name)-V,--versionβ print version and exit-v,--verboseβ be verbose (you can use this more than once, stack it up π₯)-y,--symlinkβ don't scan symlinks-Z,--sizeSIZE β print Mach-O file size
π FORMAT π
So the format string is basically a printf string β a literal string, but with flags in it requesting different pieces of info. Like, you could use a format string and expect the following results:
# scanmacho -BF "file %f needs %n; funky time" /bin/bash
file bash needs /usr/lib/libncurses.5.4.dylib,/usr/lib/libSystem.B.dylib; funky time
ok important note bestie π β when you use a format string, you should generally omit the information-related flags. Like, you do NOT want to try requesting NEEDED output (-n) AND specify a format output at the same time, because those operations are mutually exclusive. Each information-related flag has an equivalent conversion specifier, so just use those instead, periodt. You can of course keep using the non-information-related flags (like--verbose), those are chill. β¨
There are three characters that introduce conversion specifiers:
%β replace with info#β silent boolean match+β verbose match
And there's a whole bunch of conversion specifiers. We try to match up each specifier with its corresponding option:
aβ arch typebβmach_headerflagsDβ endianFβ long filenamefβ short filenameiβ dyldMβCPU_TYPEclassNβ specified needednβ needed librariespβ filename (minus search)oβmh_typeOβ permsrβ rpathsSβinstall_name
π¦ MACH-O FILETYPES π¦
You can narrow your search by specifying the Mach-O object file type. The commandline option takes the symbolic type name. Multiple values can be passed comma separated. Example -E MH_EXECUTE,MH_DYLIB
Here's the normal list, available for your pleasure π
MH_OBJECTβ intermediate object file (.o)MH_EXECUTEβ standard executable programMH_BUNDLEβdlopenplugin (.bundle)MH_DYLIBβ dynamic shared library (.dylib)MH_PRELOADβ executable not loaded by Mac OS X kernel (ROM)MH_COREβ program crash core fileMH_DYLINKERβ dynamic linker shared library (dyld)MH_DYLIB_STUBβ shared library stub for static only, no sectionsMH_DSYMβ debug symbols file (in.dSYMdir)
π§ MACH-O BITS π§
You can also narrow your search by specifying the Mach-O bitsize. Just specify the numeric value.
32β 32bitmach_header64β 64bitmach_header_64
β HOMEPAGE β
https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities
π REPORTING BUGS π
Please include as much information as possible (using any available debugging options) and send bug reports to the maintainers (see the AUTHORS section). Please use the Gentoo bugzilla at https://bugs.gentoo.org/ if possible. fr fr they want the details π«Ά
πΈ SEE ALSO πΈ
chpax(1), dumpelf(1), paxctl(1), pspax(1), readelf(1), scanelf(1), elf(5)
π AUTHORS π
- Ned Ludd
<solar@gentoo.org>β Maintainer - Mike Frysinger
<vapier@gentoo.org>β Maintainer - Fabian Groffen
<grobian@gentoo.org>β Mach-O Maintainer
π NOTES π
and that's the whole page bestie, no cap π
ok bye ily, this was pax-utils version 1.3.11, dated 08/02/2026 β slay πβ¨π¦
π¦ where this page comes from
- arch rolling: pax-utils 1.3.11-1 Β· GPL2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms