I would like to retrieve the Apple USB Keyboard's serial number from a command to use in a script.
What command can I use ?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
I don't think you can. The information that you can get is available via System Profiler:
system_profiler SPUSBDataType, which on my Macbook returns:
Apple Internal Keyboard / Trackpad: Product ID: 0x0259 Vendor ID: 0x05ac (Apple Inc.) Version: 2.24 Speed: Up to 12 Mb/sec Manufacturer: Apple Inc. Location ID: 0x14400000 / 3 Current Available (mA): 1000 Current Required (mA): 40 Extra Operating Current (mA): 0 Built-In: Yes