Checking Active Connections
Here I have used the netstat command with –inet option to check the active connections.
Secondly, you can use the lsof command to check for particular type of active connections.
Here I have used the -i option to choose a particular type of network connection.
The -i option can be followed by an argument of the form [TCP|UDP][@host][:port] to select specific network connections any or all of the components can be omitted. For example, to view all ssh connections (which use TCP), to or from any machine:
# lsof -iTCP:ssh
Below is the illustrated example from my machine.