At most you'd be able to test(1) for the existence of the device file. But you need to know the device in advance. [ -c /dev/da0] for example. And the "USB device" needs to create a /dev/ device node, certainly not all "USB devices" do. Are you testing for a specific type of USB device? If it's any random type of "USB device" then usbconfig(8) is your best bet.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.