linuxusblinux-device-driverlsusb

Is there any way to see on linux the USB devices on realtime?


My question is simple, is there a way to see in a terminal what usb devices do I have connected to my computer in real time? I already know lsusb, but it just show me the devices on the moment I ask it, I would like to be able to see if one connects and disconects at some point.

Edit: Thought the answer marked underneath gives a good alternative, in order to debug the program I was working on I found usefull useing the C++ function

std::system("lsusb");

This way I could check if I had lost or not the USB device.


Solution

  • Sure there is, you can use the udev device manager for kernel.

    Moreover you can define rules to detect plugged/unplugged devices you are interested e.g. in your case usb devices.

    Here is a tutorial on how to write a udev rule