Ao usar o comando lsusb existe um motivo para obter apenas o nome da divisão?

2

Quando eu uso o comando lsusb, recebo:

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

Existe uma maneira de obter apenas o nome do dispositivo, ou seja,

Linux Foundation 2.0 root hub
VMware, Inc. Virtual USB Hub
VMware, Inc. Virtual Mouse
Linux Foundation 1.1 root hub
    
por RamPage 25.10.2016 / 22:29

1 resposta

2
lsusb | cut -c34-

mostraria o que você precisa.

$ 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
    
por Rinzwind 25.10.2016 / 22:43