使用 lsusb 命令时为什么只获取设备名称?

使用 lsusb 命令时为什么只获取设备名称?

当我使用 lsusb 命令时,我得到:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

有没有办法只获取设备名称

Linux Foundation 2.0 root hub
VMware, Inc. Virtual USB Hub
VMware, Inc. Virtual Mouse
Linux Foundation 1.1 root hub

答案1

lsusb | cut -c34-

将显示您所需要的内容。

$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 04f2:b3fd Chicony Electronics Co., Ltd 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ lsusb | cut -c34-
Intel Corp. 
Linux Foundation 2.0 root hub
Intel Corp. 
Linux Foundation 2.0 root hub
Linux Foundation 3.0 root hub
Chicony Electronics Co., Ltd 
Linux Foundation 2.0 root hub

相关内容