How can I retrieve the information shown in the Mac's System Profiler app programatically? I'm actually interested in the USB section if that matters.
Obtaining a Mac's System Profiler data from shell
Asked Answered
The OSX command line tool "ioreg" might give you want you want.
man ioreg
ioreg displays the I/O Kit registry. It shows the heirarchical registry as an inverted tree.
Also if you can/want to use Cocoa look at IOKit. IOKit is the OSX framework that talks to USB hardware.
I think this is almost what I'm looking for. Two things though, I don't see the Volume information associated with the USB disk, for example the mount point. Second, is there a way to filter the output to get USB devices only? –
Doorn
An easy way to see OS X volume information from the command line is either using df (I usually use "df -h" for human readable format) or using diskutil (command line tool is basically Disk Utility.app). If you run "diskutil list" that will show you volume information. –
Serrate
© 2022 - 2024 — McMap. All rights reserved.