good netstat options

netstat shows you which ports are open on your linux machine. Most of the time I simply want to see which ports are open and what process opened them and this is how I do it:

# install netstat if not installed already
sudo apt install net-tools

# run netstat as root so it can display more info about processes
sudo netstat -tulpn

I heard there's a more modern replacement for this, but I my days only got so many hours.


written by uniq on 2016-09-19