Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

find ubuntu usb port tty

#!/bin/bash

for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    (
        syspath="${sysdevpath%/dev}"
        devname="$(udevadm info -q name -p $syspath)"
        [[ "$devname" == "bus/"* ]] && exit
        eval "$(udevadm info -q property --export -p $syspath)"
        [[ -z "$ID_SERIAL" ]] && exit
        echo "/dev/$devname - $ID_SERIAL"
    )
done
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #find #ubuntu #usb #port #tty
ADD COMMENT
Topic
Name
5+5 =