web-dev-qa-db-ja.com

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
2
RamPage
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
2
Rinzwind