LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to know a usb is disconnect through a port no (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-know-a-usb-is-disconnect-through-a-port-no-931041/)

rahulpr 02-24-2012 08:40 AM

how to know a usb is disconnect through a port no
 
hai,

I had connected a usb in port-no '2' and I have to run the code when the usb is disconnected. How could I know the usb is disconnect using the status of port no in shell script.

lucmove 02-24-2012 09:03 AM

Use the output of the 'lsusb' command.

catkin 02-24-2012 09:08 AM

You could use a udev rule to run a script when the USB device is unplugged.

cbtshare 02-24-2012 09:14 AM

Quote:

lsusb | grep -E device
would help


All times are GMT -5. The time now is 10:41 PM.