Get Targeted Hardware Reports with system_profiler

Print only the hardware section you need — serial number, battery, storage, network — as text or JSON.

macOShardwareinventorysystem_profilerLow risk
Run `system_profiler SPHardwareDataType` for the machine summary, or add `-json` for scriptable output.

01Command

Command
$ system_profiler SPHardwareDataType

02What it does

system_profiler is the engine behind System Information.app, and each DataType flag prints one section: SPHardwareDataType (model, serial, chip), SPPowerDataType (battery), SPStorageDataType, SPNetworkDataType, and dozens more. `system_profiler -listDataTypes` enumerates them all, and `-json` makes the output trivially parseable with jq. Full reports take seconds per section — always request specific types instead of running it bare.

03Risk

RiskLow risk

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions