How to tell which processes are uploading and downloading data (and how much)? [duplicate]

Solution 1:

I think the program Nethogs perfectly suits your requirements. From the description:

NetHogs is a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process.

You can find this tool in the package nethogs, so install it with

sudo apt-get install nethogs

The tool is started with the following command:

sudo nethogs <if>
# e.g. sudo nethogs eth0

The output looks like this:

You can cycle through various display modes with M; this will toggle between different measurement units and bandwidth usage vs. data amount.

The update interval can be set with the -d option, as described in the manpage nethogs(8).