Answers:
除了system_profiler SPUSBDataType
(由@kjs建议),您还可以使用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,$
默认情况下,它会裁剪到窗口的宽度(在上面的示例中为80个字符),因此您可能需要添加-w0
以获得全角显示。另外,添加-l
将显示每个设备的详细信息(可能超出您的需求):
$ 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...]
[编辑]:如果只需要设备名称,则可以过滤基本列表以修剪垃圾:
$ 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
ioreg
显示为已连接但diskutil list
没有显示的角落。是否有任何ioreg
我可以用来安装角落的信息?
ioreg
无法告诉您您想知道什么。
ioreg -p IOUSB -w0 -l | subl
。此ioreg命令还显示了我的虚拟盒子正在使用的设备,这确实很有帮助。