title: Identify which USB device is /dev/ttyUSB0
body: <p>I'm working with a Linux distribution (Raspbian) and I have two USB-Serial adapters which I'm connecting to the microcontroller. Whenever I connect both adapters, the serial ports &quot;/dev/ttyUSB0&quot; and &quot;/dev/ttyUSB1&quot; appear; here &quot;/dev/ttyUSB0&quot; is the adapter that was physically connected first (identified first by the system).</p>
  <p>Now, I'm looking for a way to figure out which adapter is which in the event of a microcontroller restart. I.e., both adapters remained plugged into their USB ports and I can't physically unplug/replug to force which adapter is &quot;USB0&quot;.</p>
  <p>Basic research led me to these commands (pictures for reference):</p>
  <p><code>ls /dev/ttyUSB*</code> To list out the USB-serial ports that are active.</p>
  <p><a href="https://i.stack.imgur.com/z7Dp1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z7Dp1.png" alt="Enter image description here" /></a></p>
  <p><code>lsusb</code> To get more information about the USB buses and connected devices.</p>
  <p><a href="https://i.stack.imgur.com/LCy1y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LCy1y.png" alt="Enter image description here" /></a></p>
  <p>Is there a way to relate these two results (or an alternative) to figure out what I need? For instance, in the pictures above &quot;/dev/ttyUSB0&quot; is &quot;Bus 001 Device 008: ID 1a86:...&quot;, but how can I find that out through software (preferably using Python, but a shell script could work too)?</p>