brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: system_profiler SPHardwareDataType prints a macOS machine's model, chip and serial

macOS
~/tips/tip-macos-system-profiler-hardware

system_profiler SPHardwareDataType

Shows the model, chip, memory and serial number of a Mac from the terminal.

“About This Mac” is fine with a mouse. Over SSH, or in a script that logs which machine it ran on, the terminal version is easier.

system_profiler SPHardwareDataType

That prints the hardware overview, with the machine model, its name and the serial number. I own a MacBook Pro with an M5 Pro, and this is the quickest place to read the exact model when a support page asks for it.

There are many more data types. List them with:

system_profiler -listDataTypes

SPSoftwareDataType and SPPowerDataType are two others you can ask for by name. For scripts, -json gives you JSON to pipe into jq:

system_profiler -json SPHardwareDataType

Sharing a report on a forum? Use -detailLevel mini, which the man page describes as a report with no personal information.

Caveats. Progress and error messages go to stderr and the report to stdout, so add 2>/dev/null in scripts. A full report without a data type takes a while; there is a -timeout, 180 seconds by default, after which you get a partial report. And the serial number is something I’d cut out before posting output anywhere public.

Further reading: system_profiler man page (Apple, mirrored), system_profiler reference (ss64)

More macOS tips System Settings > Accessibility > Hover Text > When using the pointer A Smart Folder in Notes collects notes by tag, checklist or date Type # in a Mac note to tag it, then filter by tag in the sidebar tmutil isexcluded ~/Projects/app/node_modules Crop an image in Preview by dragging a frame and clicking Crop All macOS tips (99) All topics

Link