Skip to content

Instantly share code, notes, and snippets.

@zhiguangwang
Created April 24, 2016 13:59
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 zhiguangwang/2863af712d8fe16562f38fdcb2e6787a to your computer and use it in GitHub Desktop.
Save zhiguangwang/2863af712d8fe16562f38fdcb2e6787a to your computer and use it in GitHub Desktop.
Convenient aliases to list TCP listeners and connections on Ubuntu
alias netls='sudo netstat -plant | grep LISTEN'
alias netls4='sudo netstat -4 -plant | grep LISTEN'
alias netls6='sudo netstat -6 -plant | grep LISTEN'
alias netlsc='sudo netstat -plant | grep -v LISTEN'
alias netlsc4='sudo netstat -4 -plant | grep -v LISTEN'
alias netlsc6='sudo netstat -6 -plant | grep -v LISTEN'
alias netlsa='sudo netstat -plant'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment