开发者

Mac Command Line - List Available Serial Ports?

开发者 https://www.devze.com 2023-01-18 10:50 出处:网络
on my Mac, i currently have the available serial ports: /dev/tty.usbserial-A700dYoR /dev/cu.usbserial-A700dYoR

on my Mac, i currently have the available serial ports:

  • /dev/tty.usbserial-A700dYoR
  • /dev/cu.usbserial-A700dYoR
  • /dev/tty.Bluetoot开发者_JAVA百科h-PDA-Sync
  • /dev/cu.Bluetooth-PDA-Sync
  • /dev/tty.Bluetooth-Modem
  • /dev/cu.Bluetooth-Modem

is it possible to retrieve a list of the available serial ports of the computer from the command line (terminal)?


ah... it is much easier than i though.

ls /dev/tty.*
ls /dev/cu.*

will list

  • /dev/tty.usbserial-A700dYoR
  • /dev/tty.Bluetooth-PDA-Sync
  • /dev/tty.Bluetooth-Modem
  • /dev/cu.usbserial-A700dYoR
  • /dev/cu.Bluetooth-PDA-Sync
  • /dev/cu.Bluetooth-Modem


You can do it with a single command:

ls /dev/{tty,cu}.*
0

精彩评论

暂无评论...
验证码 换一张
取 消