Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

lsusb

List USB buses and the USB devices connected to them.

Niveau
Dagelijks Linux
Groep
Kernel en hardware
Root nodig
Voor wijzigingen
Pakket
usbutils

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

lsusb prints one line per device with bus, device number, vendor:product ID and name. -t shows the tree with the driver of each interface; -v shows every descriptor (root for all details).

Zo schrijf je het

lsusb [OPTION]...

Opties 7

Meest gebruikt

-t, --tree
Tree with drivers and speeds.
-v, --verbose
All details.
-s [[BUS]:][DEVNUM]
Only this device, like -s 001:004.
-d [VENDOR]:[PRODUCT]
Only this vendor/product, like -d 0781:.
-D DEVICE
Read one device file, like /dev/bus/usb/001/004.
-V, --version
Show the version.
-h, --help
Show help.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1All USB devices

    lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 004: ID 0781:5583 SanDisk Corp. Ultra Fit

    Root hubs are the USB controllers themselves.

  2. 2Tree with drivers

    lsusb -t

    Driver=usb-storage shows a disk; Driver=usbhid a keyboard or mouse.

  3. 3Details of one device

    lsusb -v -s 001:004 | less

    Speed, power, interfaces.

  4. 4Filter by vendor

    lsusb -d 0781:

    All SanDisk devices.

  5. 5Find new devices while plugging in

    watch -n1 lsusb

    A new line appears.

  6. 6Connect with the block device

    dmesg -T | tail; lsblk

    A USB disk becomes /dev/sdX.

  7. 7Check for unknown devices (security)

    lsusb | grep -viE 'root hub|keyboard|mouse'

    Unknown USB devices on a server can be keyloggers or rogue network cards.

  8. 8Is usb-storage blocked?

    lsusb -t | grep -i storage

    With the blacklist, storage devices have no driver.

  9. 9USB speed

    lsusb -t | grep -o '[0-9]*M$' | sort | uniq -c

    480M = USB 2, 5000M = USB 3.

  10. 10Inventory

    lsusb > /tmp/usb-$(hostname -s).txt

    Hardware list per host.

Bestanden

/usr/share/hwdata/usb.ids
Names of vendors and products.

Exitcodes

0Done.
1Error.

Volledige handleiding

Deze pagina legt het commando uit in eenvoudige woorden. De originele handleiding heeft elk detail.

In je terminal: man 8 lsusb