Monitoring your network activity is essential for understanding how your bandwidth is being used. Tools like iftop, nethogs, and vnstat offer powerful insights into network traffic, helping you identify which processes are consuming the most data and where potential bottlenecks might be.
Iftop is a real-time network monitor that displays traffic in a top-like format, allowing you to see live data on your network interface. It can track connections by process ID, making it easy to spot which applications are using the most bandwidth. Nethogs, on the other hand, focuses on identifying which processes are responsible for the majority of data usage, giving you a clear view of what’s draining your connection. Vnstat works quietly in the background as a lightweight daemon, tracking your network usage over time and providing historical data for analysis.
If you're using a single network interface, simply run iftop with root privileges:
$ sudo iftop
For multiple interfaces, specify the one you want to monitor:
$ sudo iftop -i wlan0
While running, you can adjust the display options using keys like h
for help, n
to resolve domain names, or s
and d
to toggle source and destination addresses. You can also pause the display with p
or exit with q
.
To monitor a specific host, use the -F
option with its IP and subnet mask. For example:
$ sudo iftop -F 208.85.40.20/24 -i wlan0
This helped me find out how much bandwidth Pandora was using—around 500KB per hour. Streaming services often rely on caching, so their traffic can grow quickly over time.
Nethogs provides a quick overview of bandwidth usage by application. Run it with:
$ sudo nethogs wlan0
It lists the PID, user, and program along with sent and received data, making it easy to kill any unwanted process.
Vnstat is ideal for long-term monitoring. It doesn’t require root access and runs as a background service. The basic command shows all interfaces, but you can specify one with:
$ vnstat -i wlan0
You can also view hourly, daily, weekly, or monthly stats with -h
, -d
, -w
, or -m
. To get live updates, use -l
.
With tools like these, you can keep your network performance under control and optimize your internet usage effectively. Whether you're troubleshooting slow speeds or just curious about what's happening on your network, these commands provide valuable insight.
Telecom Battery Cabinet,Equipment Rack,Outdoor Electrical,Battery Cabinet
Guangdong Yuqiu Intelligent Technology Co.,Ltd , https://www.cntcetltd.com