Is there a way to get the '/dev/cu.*' port name from a USB device's serial number?

I'm using the following command to get the serial number:

system_profiler SPUSBDataType | grep "Serial Number"

I'm having a problem where the port name in '/dev/cu.*' keeps changing whenever I plug/unplug a USB and I'm trying to map via the serial number.

  • I was not able to determine a way to fully answer your question, but I recommend looking at the output of ioreg -l -p IOUSB and see if that can help. – n8felton Aug 26 at 2:11
  • What are you trying to accomplish ultimately? I'm doing data collection where I need to redirect output to a USB serial port. I'm fortunate in that I know there will only be one USB serial device (mine) connected, so I do "SERPORT=$(ls /dev/cu.usbmodem*) and then I can do things like "cat spoo > $SERPORT" to exfil data to my serial device. If the port name is changing on subsequent connections (I've seen this too) the serial number isn't likely going to help. – Crash Gordon Sep 9 at 21:56

You must log in to answer this question.

Browse other questions tagged .