unfortunately malicious lkms and userland rootkits can hide processes/connections from lsof/netstat
that awk expression fails here (v5.1)
Ah yes, it doesn't require the escapes that I pasted above.
awk '{a[$1"_p"$2]++;}END{ for(it in a){print it,a[it]}}'
lsof -i -n -P | grep "\\-\>" | awk '{a[\$1"_p"\$2]++;}END{ for (it in a){print it,a[it]}}' | sort -nr -k2,2
This project uses conky to display the current connexions:
https://github.com/viviparous/plonky/blob/main/plonky.pl