Greetings fellow Mac users.
I know where to find the Model Id, but I want to know the command in Terminal to get the Model Id. Just the Id.
So far I have found the following commands:
system_profiler | grep "Model Id" and sysctl hw.model
But both return more than I want. I just want the command to return "MacBookPro8,2"
if you use the above commands, you'll see that they return:
"ModelIdentifier: MacBookPro8,2" and "hw.model: MacBookPro8,2"
I have something to get just the Serial Number and it works great:
ioreg -l | awk '/IOPlatformSerialNumber/ { split($0, line, "\""); printf("%s\n", line[4]); }'
But since I'm a Mac noob I don't know what I can modify in the ioreg command to get the Model Id. Any assistance would be appreciated!
I know where to find the Model Id, but I want to know the command in Terminal to get the Model Id. Just the Id.
So far I have found the following commands:
system_profiler | grep "Model Id" and sysctl hw.model
But both return more than I want. I just want the command to return "MacBookPro8,2"
if you use the above commands, you'll see that they return:
"ModelIdentifier: MacBookPro8,2" and "hw.model: MacBookPro8,2"
I have something to get just the Serial Number and it works great:
ioreg -l | awk '/IOPlatformSerialNumber/ { split($0, line, "\""); printf("%s\n", line[4]); }'
But since I'm a Mac noob I don't know what I can modify in the ioreg command to get the Model Id. Any assistance would be appreciated!