List all connected IP Addresses
netstat -tn 2>/dev/null | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -nr | head
List all connected IP Addresses on port 80
- Netstat shows network status by listing open sockets.
- -t is TCP sockets
- -n is print symbolic host, port numbers
- You can change the port number to see other kinds of traffic (ie: 443 for SSH traffic)
- The Uniq command removes duplicate numbers
- -c counts each line once, prefixing the number of instances
- This script also sorts the IP addresses
- The Sort command lists all the lines
- -n Sorts arithmetically
- -r Reverses the sort
See other Linux one liners here
Thanks on your marvelous posting! I seriously enjoyed reading
it, you might be a great author.I will be sure to bookmark your blog and will come back from now on.
I want to encourage you to ultimately continue your great posts,
have a nice holiday weekend!
You could certainly see your expertise in the work you write.
The arena hopes for even more passionate writers such
as you who aren’t afraid to say how they believe. At all times go
after your heart.
Heya i am for the first time here. I came across this board and I find It truly useful & it helped me out
much. I hope to give something back and help others like you aided me.