Linux: Count open socket connections

Get the process ID using ps faux:

Now you may count the open socket connections of the process (including child processes):

You may also want to count all socket connections with state: CLOSE_WAIT