How to Monitor Bandwidth on Linux

Windows Articles

Error in Windows 10 preventing them from using the internet

The Windows 10 May 2020 Update brought more problems than solutions. Users around the world are complaining about a new bug. A...

How to install MyWebSQL on Ubuntu 20.04?

Managing a database server with MySQL is not an easy task. Therefore, specialized tools are required to improve the task. In Osradar...

New Office app arrives: free and renewed

Microsoft goes one step further. This time positive. This week the Redmond people launched the new Office app for Windows 10. The...

How to install Gradle on Ubuntu 20.04?

Hi, folks. In this post dedicated to Java, you will learn how to install Gradle on Ubuntu 20.04 Gradle...

Linux 5.8 Released

A few days ago, Luis Torvalds was discussing to release Linux 5.8-rc8 or he releases Linux 5.8 as stable. In the end,...
Mel Khamlichi
Mel Khamlichihttp://www.osradar.com
Founder of Osradar, from Amsterdam Netherlands

Linux is one of the best operating systems for advanced users. It lets to take control over the entire environment and have fun. Today, let’s take a look how to monitor bandwidth on Linux.

In this tutorial, we’ll be using a tool named “iftop” (Interface TOP). It’s a real-time bandwidth monitoring tool that works on the CLI. This tool will show you real-time network usage every 2, 10 & 40 seconds. Let’s get started.

Install iftop

This tool requires two dependencies – libpcap and libncurses. So, before installing the original software package, install them first. Use the following commands:

$ sudo apt install libpcap0.8 libpcap0.8-dev libncurses5 libncurses5-dev  [For Debian/Ubuntu]
# yum  -y install libpcap libpcap-devel ncurses ncurses-devel             [For CentOS/RHEL]
# dnf  -y install libpcap libpcap-devel ncurses ncurses-devel             [For Fedora 22+]

After the dependencies are installed, it’s time to install the real software. Use the following command(s) according to your Linux distro.

$ sudo apt install iftop                  [For Debian/Ubuntu]

# yum install epel-release
# yum install  iftop                      [For RHEL/CentOS]

# dnf install iftop                       [For Fedora 22+]

If your distro isn’t shown here, you can download and compile “iftop” for your distro. Download the latest TAR.GZ file from the site. Then, follow the commands in the downloaded file’s directory.

# tar -zxvf iftop-0.17.tar.gz
# cd iftop-0.17
# ./configure
# make
# make install

Iftop usage

To start iftop, run this command in the terminal.

# sudo iftop

Here’s a sample output. Remember, iftop is a CLI tool.

 

If you need to monitor any specific network interface, you have to identify the target attached network interfaces on your Linux. Use these commands to identify all the attached network interface.

# sudo ifconfig
OR
# sudo ip addr show

Then, use this command to run iftop monitoring specifically the network interface. For example, if you have to monitor “wlp2s0”, use this command:

# sudo iftop -i wlp2s0

For turning on port display, use this command:

# sudo iftop -P wlp2s0

 

In order to disable hostname lookup, use “-n” flag.

# sudo iftop -n  eth0

Additionally, you can use “S” or “D” to show “sources”, “destination” etc. For the in-depth and detailed explanations and tricks of commands, use this command to view the integrated tutorial.

man iftop

After you’re satisfied, you can turn off iftop by pressing “q” in the terminal window.

If the default screen of the terminal is scary, try out some of the best terminal emulators for Linux. It’ll help you relax a lot.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Error in Windows 10 preventing them from using the internet

The Windows 10 May 2020 Update brought more problems than solutions. Users around the world are complaining about a new bug. A...

How to install MyWebSQL on Ubuntu 20.04?

Managing a database server with MySQL is not an easy task. Therefore, specialized tools are required to improve the task. In Osradar...

New Office app arrives: free and renewed

Microsoft goes one step further. This time positive. This week the Redmond people launched the new Office app for Windows 10. The...

How to install Gradle on Ubuntu 20.04?

Hi, folks. In this post dedicated to Java, you will learn how to install Gradle on Ubuntu 20.04 Gradle...

Linux 5.8 Released

A few days ago, Luis Torvalds was discussing to release Linux 5.8-rc8 or he releases Linux 5.8 as stable. In the end,...