How to list all serial ports on Linux ?

Published on Aug. 22, 2023, 12:14 p.m.

To list all serial ports on Linux, there are a few commands you can use:

  1. ls /dev/tty*: This command lists all the serial ports available on your system. The port numbers may differ depending on your computer and the devices that are currently connected to it.
  2. dmesg | grep tty: This command displays the kernel ring buffer and filters the output to show only lines that contain “tty”. This can help identify which serial ports are connected to the system and provide additional information about them.
  3. sudo lspci -vvv: This command displays detailed information about all PCI devices connected to your system, including serial ports.
  4. sudo setserial -g /dev/ttyS*: This command displays the serial port devices that are currently configured on the system.

Note that some of these commands may require root or sudo privileges to run. Additionally, the names of the serial ports can vary depending on your system and connected devices. You may need to do some additional research or experimentation to identify the specific ports you are interested in.

Tags:

related content