When playing around with a USB controlled relay I wanted to know which physical USB port it was connected to in Linux on a Raspberry Pi.

First get the major minor device node numbers.

ls -l /dev/ttyUSB0

In my case they were 188, 0. You can then look at the information for that device.

ls -l /sys/dev/char/188:0

The result will contain a symlink to the device which will contain its physical location. In my case 1-1.3.1.3:1.0 means port 3 of a hub plugged into port 1 of another hub plugged into the pi on port 3.

I thought I'd post this here in case it helps any one else using these devices.