While reading about Linux, I got a $netstat -tulpn
to find out which process is listening Upon a port. I got:
anupam@JAZZ:~$ sudo netstat -tulpn
[sudo] password for anupam:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1827/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1992/cupsd
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 976/mysqld
tcp6 0 0 :::80 :::* LISTEN 1342/apache2
tcp6 0 0 ::1:631 :::* LISTEN 1992/cupsd
tcp6 0 0 :::3689 :::* LISTEN 2582/rhythmbox
udp 0 0 0.0.0.0:631 0.0.0.0:* 943/cups-browsed
udp 0 0 0.0.0.0:37759 0.0.0.0:* 697/avahi-daemon: r
udp 0 0 0.0.0.0:58502 0.0.0.0:* 1822/dhclient
udp 0 0 0.0.0.0:5353 0.0.0.0:* 3039/chromium-brows
udp 0 0 0.0.0.0:5353 0.0.0.0:* 697/avahi-daemon: r
udp 0 0 127.0.1.1:53 0.0.0.0:* 1827/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 1822/dhclient
udp6 0 0 :::5353 :::* 697/avahi-daemon: r
udp6 0 0 :::44452 :::* 697/avahi-daemon: r
udp6 0 0 :::16540 :::* 1822/dhclient
There is a single PID
for googleChromium
, while I have opened multiple windows and multiple tabs in it.
I read that chromium uses processes rather than threads http://blog.chromium.org/2008/09/multi-process-architecture.html, as port numbers are used for application to application connection (so I understand that there is a single PID for chromium).
But what about PIDs for other processes associated with Chromium??
The Chromium browser indeed uses different processes to render your opened tabs:
In the above example pid 6517 and 6541 are my opened tabs, but like you
netstat
only returns one network process for Chromium (6432):So why?
Sources:
You can use
pgrep -P 3039
to get all the child process IDs of Chromium. Then you can useps -p "$child_pids"
to get information about them. Or useps --ppid 3039
directly.