#!/bin/bash

a=$(cat nowcoder.txt | grep tcp | tr -s ' ' | cut -d ' ' -f 6 | sort | uniq -c | tr -s ' ' | sed 's/^ //' | sort -rn -t ' ' -k 1)
l=$(echo "$a" | wc -l)
for (( i=1;i<=$l;i=i+1 ));do
    line=$(echo "$a" | sed -n "${i}p")
    col2=$(echo $line | cut -d ' ' -f 1)
    col1=$(echo $line | cut -d ' ' -f 2)
    echo "$col1 $col2"
done