Last active
October 13, 2024 04:17
-
-
Save tomasen/e014d9a5d365c64a7fa31f23f97ec20e to your computer and use it in GitHub Desktop.
A one line command that lists connected USB devices along with their speeds on macOS. USB Hubs are filtered out.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
system_profiler SPUSBDataType | awk -F": " '/^[[:space:]]*[^[:space:]].*:$/ { device=$1; sub(/^[[:space:]]*/, "", device); sub(/:$/, "", device) } /^[[:space:]]+Speed:/ { gsub(/^[[:space:]]+Speed: /, "", $0); if (device !~ /[Hh]ub/) print device " - " $0 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment