119

Can I List USB devices on OSX - similar to lsusb on Linux. I know I can access from System Information.

152

In addition to system_profiler SPUSBDataType (suggested by @kjs), you can also use ioreg -p IOUSB:

$ ioreg -p IOUSB 
+-o Root  <class IORegistryEntry, id 0x100000100, retain 10>
  +-o EHCI Root Hub Simulation@1A,7  <class IOUSBRootHubDevice, id 0x100000227,$
  | +-o HubDevice@fa100000  <class IOUSBHubDevice, id 0x10000027a, registered, $
  | | +-o Apple Internal Keyboard / Trackpad@fa120000  <class IOUSBDevice, id 0$
  | | +-o BRCM2070 Hub@fa110000  <class IOUSBHubDevice, id 0x1000002b4, registe$
  | |   +-o Bluetooth USB Host Controller@fa113000  <class IOUSBDevice, id 0x10$
  | +-o FaceTime HD Camera (Built-in)@fa200000  <class IOUSBDevice, id 0x100000$
  +-o EHCI Root Hub Simulation@1D,7  <class IOUSBRootHubDevice, id 0x100000228,$
    +-o HubDevice@fd100000  <class IOUSBHubDevice, id 0x10000027b, registered, $
      +-o IR Receiver@fd110000  <class IOUSBDevice, id 0x100000288, registered,$

By default it clips to the window's width (80 chars in the example above), so you may want to add -w0 to get a full-width display. Also, adding -l will show details (probably more than you need) about each of the devices:

$ ioreg -p IOUSB -w0 -l
    +-o Root  <class IORegistryEntry, id 0x100000100, retain 10>
  | {
  |   "IOKitBuildVersion" = "Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64"
  |   "OS Build Version" = "14B25"
  |   "OSKernelCPUSubtype" = 3
  |   "OSKernelCPUType" = 16777223
  |   "OSPrelinkKextCount" = 185
  |   "IOConsoleLocked" = No
  |   "IORegistryPlanes" = {"IOACPIPlane"="IOACPIPlane","IOPower"="IOPower","IODeviceTree"="IODeviceTree","IOService"="IOService","IOUSB"="IOUSB","IOFireWire"="IOFireWire"}
[...etc...]

[EDIT]: If you just want the device names, you can filter the basic list to trim the junk:

$ ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*'
EHCI Root Hub Simulation
HubDevice
Apple Internal Keyboard / Trackpad
BRCM2070 Hub
Bluetooth USB Host Controller
FaceTime HD Camera (Built-in)
EHCI Root Hub Simulation
HubDevice
IR Receiver
  • still shows more than I wanted, but is a convenient 1 line per device list – Milliways Feb 2 '15 at 3:11
  • Is there a convenient way to use this information to mount a device? I have a nook that ioreg shows as connected, but diskutil list does not show it. Is there any info from ioreg that I could use to mount the nook? – stiemannkj1 Oct 19 '16 at 21:11
  • @stiemannkj1: I'm not familiar with nooks, so I'm not sure how they're supposed to show up on a Mac. As I understand it, mounting it will require a device drive that recognizes it as something disk-line (should the standard USB driver do this?), and having something like a recognizable filesystem on it. I'm not familiar enough with the driver system to know how to check this, but I don't think ioreg can tell you what you want to know. – Gordon Davisson Oct 19 '16 at 22:57
  • You can always pipe the output, such as to Sublime: ioreg -p IOUSB -w0 -l | subl. This ioreg command also shows the devices that my virtual box is using, which is really helpful. – rjferguson Jun 27 at 22:24
73

Run this command:

system_profiler SPUSBDataType
  • some ppl are just ?*! – Ruskes Feb 2 '15 at 2:57
  • 1
    Thanks - this looks like the System Information (which it probably is) but shows way too much detail, but is handy to know – Milliways Feb 2 '15 at 3:10
  • 1
    This is a better answer if you need access to fields like Vendor ID or Product ID. – CodeGnome Dec 14 '15 at 21:29
  • 2
    This shows different information, such as power usage in amps. – Simon Woodside Sep 10 '16 at 0:25
  • 5
    An additional advantage of this command is the ability to output in XML, for cases where a parseable output is needed: system_profiler -xml SPUSBDataType – Andre M Dec 2 '16 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .