Saturday, March 21, 2009

system_profiler - gathering hardware/software configuration

Another useful command line tool, system_profiler reports detailed information about the hardware and software configuration of the Mac.

It reports the same information you can find in the Apple menu / About This Mac / More Info dialog.

One of the things that makes it so useful is that you can look at the configuration of a system you are connected to remotely, like through a secure shell connection.

There are three details levels available:
  • mini - report with no personal information
  • basic - basic hardware and network information
  • full - all available information
You select which detail level by passing it using the -detailLevel switch. For example:

system_profiler -detailLevel mini

If no detail level is passed, the default level is full.

Because it generates so much information, you typically pass the output to the "less" utility, redirect it to a text file for browsing, or filter out what you are looking for using "grep".