How do I uniquely identify an USB-device?

Ram Natarajan picture Ram Natarajan · Dec 1, 2010 · Viewed 8.4k times · Source

I was wondering how to get the unique id of a USB storage device. I already know how to fetch the SCSI serial id from this post : USB-drive serial number under linux C++ The post mentions using the Device Descriptor to get the ID. Can someone post some code to determine the Device Descriptor information under Linux?

Answer

chris picture chris · Dec 1, 2010
ls -l /dev/disk/by-id