Log ports opened by an application
- by Simon A. Eugster
I'm searching for something like:
tcpdump -p PID # But tcpdump does not know the PID
or
lsof -i --continuous # But lsof just runs and exits, no «live logging»
to log which connections an application opens.
In my case, I want to find out to which port git connects when committing. This happens in a fraction of a second, so I cannot use lsof. If there is a lot of traffic, filtering by PID or process name would be useful.