Obtaining a Mac's System Profiler data from shell
Asked Answered
D

2

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.

Doorn answered 9/1, 2009 at 1:59 Comment(0)
F
2

Take a look at the system_profiler(8) command.

Forsta answered 9/1, 2009 at 16:18 Comment(0)
S
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.

Serrate answered 9/1, 2009 at 2:27 Comment(2)
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
F
2

Take a look at the system_profiler(8) command.

Forsta answered 9/1, 2009 at 16:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.