lsof -c $PROGRAM - list files for program like $PROGRAM
lsof -c $PROGRAM
lsof -i TCP - list TCP files
lsof -i TCP
Remember to use -a to join rules, e.g. lsof -a -c node -i TCP
-a
lsof -a -c node -i TCP
Recall that socket connections are represented as files in *nix systems.
An lsof Primer