Sunday, March 29, 2015

How To Check iMac Serial Number Using The Command Line


Find out here how to check iMac serial number via the command line by using the system_profiler command and grep for the serial string. Getting Mac serial info like this can be really helpful for various issues fix, Single User Mode, remote management with SSH, or for many other reasons.

To get Mac serial number navigate to the Apple menu or from System Profiler, the Terminal app method can be done only by advanced users and for many other reasons.


How To Check iMac Serial Number From Command Line In OS X


To get the serial number on any OS X machine you should enter the appropriate command string below at the Terminal, depending on the version of OS X in use on the Mac. Be sure the command is on a single line, as usual with command line syntax.

On OS X modern versions, like Yosemite and Mavericks, the following string will retrieve the Macs serial number:

  • system_profiler |grep "Serial Number (system)"

The results for this string will look like this:

  • $ system_profiler |grep "Serial Number (system)"
  • Serial Number (system): B041FAFDLLJA8

The serial number will be shown as an alphanumeric string near “Serial Number (system)”, in case you simply grep for “serial” you’ll find a huge number of returns that are unrelated to the systems actual serial number, thus we don’t do that.

To achieve the systems serial number in OS X older versions, use the following system_profiler and grep string:

  • system_profiler |grep "r (system)"

The command results will look as following:

  • $ system_profiler |grep "r (system)"
  • Serial Number (system): C24E1322XXXX

Again, the alphanumeric string after “Serial Number (system)” is the serial number. As in the new versions, if you just grep for “Serial Number” you’ll see serial numbers to other hardware included in the Mac, which is why the “r (system)” qualifier is included.

If some issues will appear here you can work with the About This Mac approach instead. You can check iMac serial number is also possible from the System Profiler application. With a serial number, you can various things as checking AppleCare warranty status and repairing history.

Tags:

0 Responses to “How To Check iMac Serial Number Using The Command Line”

Post a Comment

Subscribe

Subscribe - How to Unlock Find My iPhone activation status