Question: What command can I use to retrieve the system's serial number from the unix command line? As `uname` will output some information about the software and hardware, I would like to retrieve the serial number from a command to use in a script.

Answer: 
This also works…

```
ioreg -l | grep IOPlatformSerialNumber

```
To make it easier to remember, use a case insensitive search: 

```
ioreg -l | grep -i serialnumber | grep -i platform

```