Get System Information from the command line
April 23rd, 2007 - Command Line, How to, Mac OS X, Tips & Tricks
Regardless of how many Mac’s you administer, there will surely come a time when you’ll need to retrieve relevant System Information. Gathering system information from the command line is vital for system and network administration, so the next time you’ve accessed a machine through SSH, find out what you need to know with two helpful command line tools. Here’s how, using the the sw_vers command and the system_profiler command:
sw_vers
The sw_vers command is short and sweet, it will give you the current operating system version and build number, with output as such:
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.4.9
BuildVersion: 8P2137
system_profiler
system_profiler is just a command line interface to the GUI app System Profiler (found in your Utilities folder). It’s very handy for learning about a machine over a network or remote connection via SSH. The standard output will blast you with screenfulls of content so it is best to pipe through the more command as follows:
$ system_profiler | more
This will allow you to view the output of system_profiler one screen at a time, navigable by the arrow keys and page up/down.
If you’re looking for information on your Airport connection, be sure to use the hidden Airport utility discussed here.
Posted by: David Mendez

Order Mac OS X 10.6 Snow Leopard today from Amazon.com - $25!

Write a comment