Use netstat to See Internet Connections

Using netstat, you can monitor programs that are making connections to remote hosts:

$ netstat -tpe

The -t flag limits the output to show only TCP connections. The -p flag displays the PID and name of the program making the connection. The -e flag displays extra information, such as the user name under which each program is running.