Get a Macs Serial Number from the Command Line

Apr 25, 2011 - 7 Comments

You can quickly retrieve any Macs serial number via the command line by using the following command string:

system_profiler |grep "r (system)"

The command results will look something like this:

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

If you just grep for “Serial Number” you’ll be presented with serial numbers to other hardware included in the Mac, which is why the “r (system)” qualifier is included.

Once you have a serial number, you can do things like check AppleCare warranty status and repair history.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: David Mendez in Command Line, Mac OS X


» Comments RSS Feed

  1. stus says:


    system_profiler SPHardwareDataType | grep “Serial”

  2. Squanto says:

    Using “About this Mac” under the Apple menu us much easier. Click the line between Mac OS X and above the Software Update button (by default you’ll see the version number, first click shows the build number and the second click will show your Mac’s serial number.)

    • Brandon says:

      The solution described by this post’s title, and indeed the whole purpose, is to get the computer’s serial number via the COMMAND LINE. How many paint chips did you eat as a child, Squanto?

  3. B0bby says:

    Lol @ one machine in my office i have this serial number:

  4. motoko says:

    system_profiler SPHardwareDataType | awk ‘/Serial Number/ { print $4; }’

  5. David Dobie says:

    less to type and easier to remember

    system_profiler | less

    give the whole first page of system profile

Leave a Reply


Shop for Apple & Mac Deals on

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates