Skip to content

Instantly share code, notes, and snippets.

@chadmayfield
Last active June 16, 2016 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadmayfield/403ded01930bc8bfcc9d716d18ddfed6 to your computer and use it in GitHub Desktop.
Save chadmayfield/403ded01930bc8bfcc9d716d18ddfed6 to your computer and use it in GitHub Desktop.
View established connections with hostnames
#!/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