Home > Software engineering >  How to monitor all network traffic from a specific process in linux?
How to monitor all network traffic from a specific process in linux?

Time:08-13

I want to monitor and log all traffic that a specific process produces.

I know about tcpdump, but it seems it doesn't support filtering by process (pid/path, or at least user).

It there any other way to log all traffic from a process? Ideally I should be able to filter ports as well.

Thanks!

CodePudding user response:

You should use strace command:

strace -o /tmp/network.out -e trace=network -fp <PID>
  • Related