On Thursday, August 09, 2012 17:34:20, Michael Quick wrote: > Hi, > In a bash script I want to list all of the USB drives that have been > connected to my system. Anyone have a clue on the best way to do this ?
It depends on what you're looking for. 'lsusb' can list USB devices, but that will only get you a device ID. If what you're looking for is a device you can *mount* then I suggest looking under /dev/disk/<subdirs> which is the area where udev. Within there are several subdirectories: /by-label/ -> you can mount devices by drive label /by-uuid/ -> you can mount by filesystem UUID /by-path/ -> you can mount device partitions by path /by-id/ -> you can mount filesystems by device ID -- Chris -- Chris Knadle [email protected] _______________________________________________ Mid-Hudson Valley Linux Users Group http://mhvlug.org http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug Upcoming Meetings (6pm - 8pm) Vassar College Sep 5 - OpenStack Oct 3 - Mobile Web Development Nov 7 - Typography: Physical Art to Digital Art
