Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
2 edited tags
| link
source | link

Show network connections of a process

There is a way to show the connections of a process? Something like that:

show PID

in which show is a command to do this, and PID is the pid of the process. The output that I want is composed by all the connection of the process (in real-time). For example, if the process try to connects to the output is

A more specific example with Firefox:

show `pidof firefox`

and with firefox I go at first on, then on and finally The output, when I close the brower, must be:

(Obviously with the browser this output is not realistic, because there are a lot of others related connections, but this is only an example.)