Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get number of connections of a process
#Option 1: lsof
sudo lsof -n -i | grep 23889 | wc -l
#Option 2: python + psutil
>sudo python
import psutil
where 23889 is the PID of the process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment