linux – How to Be Notified When USB Device is Plugged In

deviceslinuxnotificationsusb

My system has to auto-mount USB devices; how can I be notified when a USB device is plugged in? Where can I read more about this subject?

I would like to handle this problem via C or a shell script.

Best Answer

Udev support running external programs

KERNEL=="sdb", RUN+="/usr/bin/my_program"
Related Question