Listing devices on Linux

  • ls – list files in the file system
  • lsblk – list the block devices (i.e. drives)
    • mount| grep /dev/sd – lists mounted partitions
  • lspci – list the pci devices
    • lspci -vv
    • lspci -vvv
  • lsusb – list the USB devices
  • lsdev – list all the devices

List serial ports

Linux uses ttySx for a serial port device name. For example, COM1 (DOS/Windows name) is ttyS0, COM2 is ttyS1 and so on.

  • dmesg |grep tty
  • setserial -g /dev/ttyS[0123]