explaingit

raboof/nethogs

Analysis updated 2026-05-18

3,620C++Audience · ops devopsComplexity · 2/5LicenseSetup · easy

TLDR

A command-line Linux tool that shows which running program is using your network bandwidth right now, grouped by process.

Mindmap

mindmap
  root((NetHogs))
    What it does
      Groups traffic by process
      Reads proc filesystem
      Terminal display
    Tech stack
      C++
      ncurses
      libpcap
    Use cases
      Find bandwidth hogging apps
      Diagnose sudden traffic spikes
      Run without root via setcap
    Audience
      Sysadmins
      Linux power users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Find which process is suddenly consuming network bandwidth on a Linux server.

USE CASE 2

Install via apt, yum, or pacman for a quick per-process bandwidth view.

USE CASE 3

Grant setcap permissions so a non-root user can run bandwidth monitoring.

USE CASE 4

Build the libnethogs library to feed per-process bandwidth data into another program.

What is it built with?

C++ncurseslibpcap

How does it compare?

raboof/nethogsyue/yuetildearrow/furnace
Stars3,6203,6203,622
LanguageC++C++C++
Setup difficultyeasymoderateeasy
Complexity2/53/53/5
Audienceops devopsdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Most Linux distros package it directly, so a single package-manager install usually gets it running.

You can redistribute and modify it, but derivative works must also be shared under the same GPLv2 or later license.

In plain English

NetHogs is a command-line monitoring tool for Linux that answers a specific question: which running program is eating your network bandwidth right now? Most network monitoring tools break traffic down by protocol or by which machines are talking to each other. NetHogs takes a different approach and groups all network activity by the process that caused it, so you can immediately spot a program that has suddenly started sending or receiving unusually large amounts of data. The tool reads process information directly from the Linux kernel via the /proc filesystem. Because of this dependency, the full feature set is only available on Linux. You can build it on Mac OS X and FreeBSD, but on those systems it will only show raw connections without linking them to specific programs. Using it is straightforward. You install a couple of standard development libraries (ncurses for the terminal display and libpcap for packet capture), compile the code with a single make command, and run the resulting binary with administrator privileges. Most major Linux distributions already package it, so you can often just install it directly through apt, yum, or pacman rather than building from source. If you prefer not to run it as root every time, you can grant the binary specific capabilities using the setcap command. This allows a regular user to run NetHogs with just the permissions it actually needs, rather than full root access. The codebase also builds as a library called libnethogs, which lets other programs tap into the per-process bandwidth data. The README notes this is experimental and the interface is likely to change. There is also a list of related tools for users who want to monitor traffic from different angles, such as by host, by connection type, or with a graphical interface.

Copy-paste prompts

Prompt 1
Help me install NetHogs on Ubuntu and run it to check which process is using my bandwidth.
Prompt 2
Explain how to use setcap so I can run NetHogs without root.
Prompt 3
Show me how to build NetHogs from source with the required ncurses and libpcap libraries.
Prompt 4
Walk me through using libnethogs to get per-process bandwidth data in my own program.

Frequently asked questions

What is nethogs?

A command-line Linux tool that shows which running program is using your network bandwidth right now, grouped by process.

What language is nethogs written in?

Mainly C++. The stack also includes C++, ncurses, libpcap.

What license does nethogs use?

You can redistribute and modify it, but derivative works must also be shared under the same GPLv2 or later license.

How hard is nethogs to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is nethogs for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.