178

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

Milliways
  • 7,608
  • 18
  • 56
  • 80
  • possible duplicate of [List all devices connected, lsblk for Mac OS X](http://apple.stackexchange.com/questions/107953/list-all-devices-connected-lsblk-for-mac-os-x) – soulshined Feb 02 '15 at 00:22

2 Answers2

237

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
Gordon Davisson
  • 32,089
  • 6
  • 67
  • 90
106

To list all USB devices run the command-line counterpart of built-in utility System Information (previously known as System Profiler) in a shell:

system_profiler SPUSBDataType
hc_dev
  • 160
  • 1
  • 7
Kevin Stewart
  • 1,160
  • 1
  • 7
  • 8
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/118669/discussion-on-answer-by-kevin-stewart-list-usb-devices-on-osx-command-line). – bmike Jan 19 '21 at 22:17