# For a list of ips, ping all of them and sort into latency buckets (by 10ms) # and output the first 3 in each bucket. Remove the ' | fex ...' at the end to # get all hosts in each bucket ... | fping -c 1 -q |& fex 1 -1/1 | awk '{$2 = sprintf("%.0f", $2/10) * 10; a[$2] = a[$2]""$1","} END { for (i in a) {print i"ms:", a[i] } }' | sort -n | fex ',{:3}' Example: % echo 8.8.8.8 8.8.4.4 www.csh.rit.edu www.semicomplete.com www.google.com | xargs -n1 | fping -c 1 -q |& fex 1 -1/1 | awk '{$2 = sprintf("%.0f", $2/10) * 10; a[$2] = a[$2]""$1","} END { for (i in a) {print i"ms:", a[i] } }' | fex ',{:3}' 20ms: 8.8.8.8,www.google.com 30ms: 8.8.4.4 70ms: www.semicomplete.com 120ms: www.csh.rit.edu