I have a mouse that will stop working randomly. The solution is easy, unplug and replug. Is there a way I can do this via the command line though? Doing via command line has a few advantages.
- Doesn't wear out the connector.
- Faster.
- Saves me the trouble of crawling under my desk.
- Most important: prevents me from accidentally unplugging something else.
Plus I am curious how to do this.
OS is Debian 8.
Thanks!
Best Answer
Save the following to
usbreset.c
The run the following commands in terminal:
Compile the program:
Get the Bus and Device ID of the USB device you want to reset:
Make our compiled program executable:
Execute the program with
sudo
privilege; make necessary substitution for<Bus>
and<Device>
ids as found by running thelsusb
command:Source of above program: http://marc.info/?l=linux-usb&m=121459435621262&w=2