![Forrest logo](/images/logo.png)
nethogs:tldr:a8450
The command "sudo nethogs" is used to monitor network traffic in Linux systems. It displays a real-time breakdown of the network bandwidth consumed by each application or process on your system.
When you execute "sudo nethogs," it launches a console-based application that captures network statistics and presents them in a tabular format. The table typically includes information such as the process ID (PID), user, program name, and the amount of data sent and received by each process.
By default, nethogs displays the traffic for all network interfaces on your system. However, you can specify a particular network interface using the "-d" flag followed by the interface name (e.g., "-d eth0").
The "sudo" command is used at the beginning to run nethogs with administrative privileges. This is necessary because only privileged users (such as root or users in the sudoers list) are allowed to monitor network traffic.
Overall, "sudo nethogs" provides a useful way to diagnose network-related issues and identify any applications or processes that may be using excessive bandwidth.