Useful macOS Terminal Commands

Safe, practical Mac inventory, troubleshooting and repair references

Technical Reference

System and hardware

TopicProcedure / notes
system_profiler SPHardwareDataTypeHardware overview including model and serial number.
system_profiler SPMemoryDataTypeMemory information where supported; Apple silicon unified memory details vary.
system_profiler SPPowerDataTypeBattery and power system details.
sysctl -n machdep.cpu.brand_stringCPU brand on Intel Macs; may not be available on Apple silicon.
uname -mArchitecture, e.g. arm64 or x86_64.

Storage and system

TopicProcedure / notes
diskutil listList physical disks and partitions.
diskutil apfs listShow APFS containers and volumes.
df -hFilesystem usage in readable units.
softwareupdate --listCheck available macOS software updates.
pmset -g battBattery percentage and charging state.

Networking and logs

TopicProcedure / notes
networksetup -listallhardwareportsMap network services to interfaces.
ifconfigList network interfaces and addresses.
scutil --dnsShow effective DNS resolver configuration.
ping -c 4 1.1.1.1Basic IP reachability test.
log show --last 10m --style compactView recent unified logs; output may be large and include private data.

Service note: Model, firmware version and region can change key combinations and hardware options. Verify the exact device service manual and back up important data before repairs.

Diagnostic Tools