Last active
June 16, 2016 19:15
-
-
Save chadmayfield/403ded01930bc8bfcc9d716d18ddfed6 to your computer and use it in GitHub Desktop.
View established connections with hostnames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
netstat -tunlap | awk '{print $5}' | grep [0-9] | egrep -v '(127|0).0.0.*|::1'| awk -F ':' '{print $1}' | sort -u | xargs -n 1 host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment