Sign Up

Sign In

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the capital of Egypt? ( Cairo )

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

netstat with group by (ip adress)

– netstat -ntu | awk ‘ $5 ~ /^[0-9]/ {print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

 netstat with group by (ip adress)

netstat has two lines of headers:

Active Internet connections (w/o servers)

Proto Recv-Q Send-Q Local Address Foreign Address State

Added a filter in the awk command to remove them

–  netstat -ntu | awk ‘ $5 ~ /^[0-9]/ {print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

netstat with group by ip adress

– netstat -ntu | awk ‘ $5 ~ /^(::ffff:|[0-9|])/ { gsub(“::ffff:”,””,$5); print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr

Same as the rest, but handle IPv6 short IPs. Also, sort in the order that you’re probably looking for.

– netstat -nt | awk -F”:” ‘{print $2}’ | sort | uniq -c

 count connections, group by IP and port

Hits: 1

Leave a comment

What is the capital of Egypt? ( Cairo )