1. Home
  2. Computing & Technology
  3. Linux
Linux / Unix Command: usbmodules
Command Library

NAME

usbmodules - List kernel driver modules available for a plugged in USB device  

SYNOPSIS

usbmodules [--device /proc/bus/bus/NNN/NNN] [--check modulename] [--help] [--mapfile pathname] [--version pathname]  

DESCRIPTION

usbmodules lists driver modules that may be able to manage interfaces on currently plugged in USB devices. usbmodules may be used by /sbin/hotplug or one of its agents (normally /etc/hotplug/usb.agent) when USB devices are "hot plugged" into the system. This can be done by the following Bourne shell syntax:
       for module in $(usbmodules --device $DEVICE) ; do
               modprobe -s -k "$module"
       done

The DEVICE environment variable is passed from the kernel to /sbin/hotplug during USB hotplugging if the kernel was configured using usbdevfs. usbmodules currently requires usbdevfs to operate.

When a USB device is removed from the system, the Linux kernel will decrement a usage count on USB driver module. If this count drops to zero (i.e., there are no clients for the USB device driver), then the modprobe -r process that is normally configured to run from cron every few minutes will eventually remove the unneeded module.

 

OPTIONS

--check modulename
Instead of listing the relevant modules, just exit with code 0 (success) if the given module's exported USB ID patterns matches. Otherwise, return failure. usbmodules emits no output either way.
--device /proc/bus/usb/MMM/NNN
Selects which device usbmodules will examine. The argument is currently mandatory.
--help, -h
Print a help message
--mapfile /etc/hotplug/usb.handmap
Use the specified file instead of the /lib/modules/.../modules.usbmap file corresponding to the running kernel.
--version
Identifies the version of usbutils this tool was built with.
 

SEE ALSO

lsusb(8), http://linux-hotplug.sourceforge.net

 


Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

Explore Linux

More from About.com

  1. Home
  2. Computing & Technology
  3. Linux

©2008 About.com, a part of The New York Times Company.

All rights reserved.