--- On Wed, 4/5/11, Rajesh kumar <[email protected]> wrote:
> When we connect the usb device it
> will reside as /dev/sdb, /dev/sdc etc.,
> We can find that using fdisk -l
>
> Is there any command to list all the usb devices location,
> like below
>
> $<command>
> /dev/sdc
> /dev/sdb
/sys/block contains data about block devices. A file named 'removable' contains
1 if it is removable devices. You can build upon this basic find and grep.
find . -name '*remov*' -exec grep -l 1 {} \;
This one lists cd drives also. It will show event umounted one. It will be
interesting to expand this script, to omit such devices.
Raman.P
blog:http://ramanchennai.wordpress.com/
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc