HomeHow ToHow to monitor network traffic on Linux

How to monitor network traffic on Linux

-

On Windows, if you realize that a given app is hogging your bandwidth, then the process to fix this issue is pretty straightforward.

You have to just fire up the Task Manager, click on the Network tab, and sort the list to find out which application, service, or activity is hogging your network.

From here, you can kill the service or let it finish what it is doing so you get back to using your PC normally.

Pretty simple, right? So what do you do when you’re facing the same issue but on Linux?

Well, in this post, we guide you through perhaps the simplest way of going about this.

Worth noting is that, due to the open-source nature of Linux, there is no single way of doing this.

This depends on what kind of function you need to perform after finding out the culprit, what Linux Distro you’re using, and so on.

For the purpose of the demonstration, I’ll be showing you my specific way of doing it on Pop OS! This should work on all other Debian-based distros.

How to monitor network usage in Linux with Nethogs

So there are countless tools, and my preferred is called Nethogs.

For most distros, this tool is available in supported repositories, so installation should be as easy as running the following line on your terminal as admin.

sudo apt install nethogs
Install Nethogs

You might need to authorize the superuser operation using your password and then hit enter. This should install the tool on your Linux system.

Next, you’ll need to open the terminal again and run the following command.

sudo nethogs
Run Nethogs

You will then have to authenticate with your password, and then you’ll see a list of processes that are using your bandwidth.

From here, you can use the xkill command to terminate the culprit application.

Terminate the application

While this is my go-to tool, it is far from the most feature-packed or most elegant solution. Some other notable tools include:

  • Speedometer
  • CBM – Color Bandwidth Meter
  • Bwm-ng
  • Vnstat
  • Darkstat
  • IPTraf

Linux might seem intimidating for the average computer user, but times have changed, and the convenience of choice is something that could work in favor of these casual computer users as there are simple tools that don’t over-complicate tasks as once thought and Nethogs is just one of those.

What’s your preferred tool for monitoring network traffic on Linux? Tell us in the comments section below.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular