1.netstat -ltunp | grep 80 | grep LISTEN | grep java | awk '{print $4}' |awk -F: '{if ($NF>8000 && $NF<8100) print $NF}'
8001
8002
8018
8019
2.awk -F "[/]+" '{array[$2]++}END{for(key in array)print key,array[key]}' 20.txt
网址 1 //输出网址域名出现次数
网址2 3
网址3 2
网址4 1
3.awk -F "[/]+" '{print $2}' 20.txt
输出网址
5.awk '{array[$2]+=$3}END{for(key in array)print key,array[key]"K"}' 21.txt
sdsd 9K
wodi 18K
sdex 12K
ying 14K
ksdj 10K
6.awk -F "[ :]+" '{array [$4" "$6]++}END{for(key in array)print key,array[key]}' 22.txt
0.0.0.0 0.0.0.0 18
127.0.0.1 0.0.0.0 4
转载于:https://blog.51cto.com/yzg784534398/1658547