netstat -nlpt

To include information of tasks which are executed with sudo privilege

sudo netstat -nlpt