Mac Administration: A Closer Look at System Information

Mac Administration: A Closer Look at System Information

System Information (formerly System Profiler) in OS X provides a detailed breakdown of the hardware and software configuration of a Mac, from Bluetooth information and attached USB devices to installed software and extensions. 

While most of us have used System Information at one time or another, it’s an often overlooked and undervalued tool. To get the most out of it, we’ll exploring the app, and its lesser-known command-line options, in further detail.

Launching System Information

There are a number of ways you can access System Information as it has a number of shortcuts in different places, the most common way is from the About This Mac pane.



Choose Apple menu () > About This Mac to get an overview of your Mac, including your Mac model, processor, memory, serial number, and version of macOS

To see the greater detail provided by System Information, click the System Report button.

System Information opens to a system report for your Mac:



Select items in the sidebar to see information about each item. For example, the Hardware section shows your Mac serial number, the Memory section shows how much RAM is installed in each internal memory slot, and the Software section shows which startup disk (boot volume) your Mac is using. You can use the Network section and the Network Utility to learn more about your network.
To have System Information read your serial number aloud, choose File > Speak Serial Number.
To save a copy of your system report, choose File > Save.
To learn more about System Information, choose Help > System Information Help.

Generating Reports

To get started, open Terminal and enter the command system_profiler. You’ll notice that (after a brief delay) a lot of system information is displayed within the Terminal window.

Running the command without any arguments just dumps the entire system report to the screen. If we wanted to find out what the Mac’s Model Identifier is, we could use:
system_profiler | grep "Model Identifier"

This isn’t very efficient as running system_profiler generates a complete report each time, which can be time consuming if the Mac contains a lot of software or isn’t particularly speedy. 
Instead, we can generate a report only on a particular part of the Mac, such as network or storage information, by specifying a Data Type. What data types are available depend on the Mac’s hardware capabilities and configuration. 
To list all of the available types of data, use the listDataTypes argument:
system_profiler -listDataTypes
You can request a system report on only a specific part of the hardware by invoking the system_profiler command, along with the data type, like so:
system_profiler SPCameraDataType
The Mac’s Model Identifier is located within the SPHardwareDataType data type. By generating a report just using that data type, the result to our grep search is substantially quicker:
system_profiler SPHardwareDataType | grep "Model Identifier"



Saving a System Report

To save a text-only version of a system report to your desktop, you can use the following command:
system_profiler > ~/Desktop/system_report.txt

As you’re redirecting the output to a text file rather than the terminal window, any reports you generate (including on specific data types) can be saved.

Full Report Detail Level

By default, system_profiler generates a complete system report. Just like System Information, we can choose to generate a more basic one using the argument detailLevel:
system_profiler -detailLevel [basic|mini|full] > ~/Desktop/system_report.txt

There are three different levels of detail that can be used:
  • mini (report with no personal information, such as Serial Number of Hardware UUID)
  • basic (basic hardware and network information)
  • full (all available information)
So to generate a basic report, the command would be:
system_profiler -detailLevel basic > ~/Desktop/system_report_basic.txt

Opening Reports in System Information

So far, the reports generated have all been plaintext. To create System Information-compatible reports, an additional argument would be needed, xml, and the file extension specified must be .spx.
Combining all of this together, an example command would be:
system_profiler -detailLevel mini -xml > ~/Desktop/system_report_mini.spx

These reports can then be opened within System Information and more easily viewed.

Wrapping Up

The ability to generate system reports via the command-line using system_profiler provides a level of flexibility that System Information cannot, such as generating or scheduling reports on remote Macs via SSH. This can be advantageous when trying to determine what software is installed on which Mac or if any users are running an outdated version of OS X.

留言

熱門文章