1

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.

Abdullah Jibaly
  • 50,216
  • 39
  • 119
  • 196

2 Answers2

3

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.

bkaid
  • 50,475
  • 21
  • 110
  • 127
hacintosh
  • 3,684
  • 4
  • 18
  • 22
  • 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? – Abdullah Jibaly Jan 09 '09 at 03:31
  • 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. – hacintosh Jan 09 '09 at 03:53
2

Take a look at the system_profiler(8) command.

Dave Dribin
  • 5,603
  • 3
  • 27
  • 18