Internet access is essential, but you may wonder which Linux processes use your connection the most on your computer. Fortunately, with some common Linux utilities, monitoring which processes use your bandwidth is easy. Here are some of them:
1. nethogs
nethogsis a program that does for internet connections what htop ortop does for CPU and memory usage. It shows you a snapshot of which processes are accessing the network.
Like top, htop, or atop, nethogs is a full-screen program that updates after a few seconds to show you the current network connections by processes.

Installing nethogs is simple. You just go through your package manager.
For example, on Debian and Ubuntu:

And on Arch Linux:
On the Red Hat family:
To run nethogs, you’ll need to be root:
It’s possible to set it so that you can run nethogs as a regular user using this command:
You should replace “/path/to/nethogs” with the absolute pathname of nethogs. You can find this with the which command:

Whilelsof is a utility for listing open files, it can also list open network connections. The-ioption lists internet connections attached to running processes on the system. On Linux, everything is a file, after all.
To see current internet connections, use this command:
lsof will show you the name of any commands with open internet connections, the PID, the file descriptor, the type of internet connection, the size, the protocol, and the formal file name of the connection.
Using the-i4and-i6options allows you to view connections using IPv4 or IPv6.
There’s a good chance you have lsof installed already. It’s also easy to install on major Linux distros if it isn’t.
On Debian and Ubuntu, type:
And on Arch:
On the Red Hat family of distros:
3. netstat
netstat is a powerful program on its own, letting you see network connections on your system. It doesn’t show you which processes the network connections are attached to. As with lsof, you’re able to see this with a command-line option.
netstat is part of the net-tools package. You can install it on most Linux distros using the default package manager.
For example, on Debian or Ubuntu:
On Arch Linux:
To install netstat on Fedora, CentOS, and RHEL, run:
You can run netstat at the command line. By default, it will show you information such as the protocol, the address, and the state of the connection, but the-poption adds a column that shows the process ID and the command name.
When you run it, netstat will just list all the network connections and then exit. With the-coption, you can see a continually updated list of connections:
This would be similar to using a screen-oriented program like nethogs, but the advantage of doing it this way is that you can pipe the output into another program like grep or a pager to examine it:
To see all of the processes with network connections on your system, you may have to run netstat as root:
Now You Can See Which Linux Apps Are Gobbling Up Your Bandwidth
Linux, like many modern OSes, is intimately connected to the internet. It can be difficult at times to track down which processes are using your bandwidth. With tools like nethogs, lsof, and netstat, you can track down processes that have open connections.
Processes sometimes go haywire, even with connections. On Linux, you may easily terminate any rogue processes.