1. system_profiler SPHardwareDataType | grep Serial
  2. ioreg -l | grep IOPlatformSerialNumber
  3. ioreg -rd1 -c IOPlatformExpertDevice | awk -F'"' '/IOPlatformSerialNumber/{print $4}'

Sources:

That's it for this post, thanks for reading!