Skip to content

Latest commit

 

History

History
executable file
·
59 lines (35 loc) · 1.2 KB

socket.md

File metadata and controls

executable file
·
59 lines (35 loc) · 1.2 KB

ss

#netstats

netstat -tuan | grep ':8888' | awk '{arr[$6]++}END{for (i in arr){print i,arr[i]}}'

netstat -tuan | grep ':6903' | awk '{arr[$6]++}END{for (i in arr){print i,arr[i]}}'

#netstat

  • check which connection is abnormal

netstat -nt | cut -c 40- | cut -d: -f1 | sort | uniq -c | sort -n

OR

amount-port-ip

netstat -nt | cut -d: -f2 | sort | uniq -c | sort -n

  • check all connection status
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 

TIME_WAIT 5009
FIN_WAIT1 19
ESTABLISHED 3
FIN_WAIT2 2
SYN_RECV 14
CLOSING 146
LAST_ACK 1


netstat -tuan | grep ':9999' | awk '{arr[$6]++}END{for (i in arr){print i,arr[i]}}'