How to use nload command in Linux.

How To Use Nload Command In Linux.

nload is a CLI (Command Line Interface) tool used to monitor network traffic and track real-time bandwidth usage. It is a console application that monitors real-time bandwidth usage and network traffic. It provides insights into all the outgoing and incoming network traffic with graphs. Also, it provides useful information like min/max usage of the network, the total amount of data that has been transferred over the network, etc. This tutorial is designed to give you a walkthrough of the nload command in the Linux operating system.

 

How To Install the nload Command?

To install the nload command on a Linux distribution, you’ll typically use your package manager. The process might vary slightly depending on the specific Linux distribution you’re using. Here are the steps for a few popular package managers:

  1. Using APT (Debian/Ubuntu):

Open a terminal and run the following commands:

sudo apt update
sudo apt install nload
  1. Using Yum (CentOS/RHEL):

Open a terminal and run the following commands:

sudo yum install epel-release  
# Only if EPEL repository is not already installed
sudo yum install nload
  1. Using DNF (Fedora):

Open a terminal and run the following command:

sudo dnf install nload
  1. Using Zypper (openSUSE):

Open a terminal and run the following command:

sudo zypper install nload
  1. Using Pacman (Arch Linux):

Open a terminal and run the following command:

sudo pacman -S nload

 

How To Monitor the Network Using the nload Command

As we already know, the nload command gives incoming and outgoing network traffic information. So let us see how to use the nload command to view the details.

Type the “nload” command on the terminal and press enter to see a similar result:

Note that the output shows Device eno1 [XX.XX.XX.XX] (1/2), indicating two devices on the network. You can also switch between the devices, and for that, all you have to do is, use the left or right arrow key on the keyboard. The previous output is the network report of the first device. Here is the network report of the second device:

If you want to get the details of both devices simultaneously, use the -m command with nload. See the following command:

The result of the -m command will show the result of the network on all the devices without any graph. Here is the following result:

 

Set the Time Window With the -a Command

The -a flag with nload is used to set the length of the time window in seconds to calculate the average. By default, the length of the window is 300. Let us set the time window length to 30 seconds with -a flag. See the following command:

The result of the command is as follows:

 

Set the Refresh Interval With the -t Flag

The nload command allows you to set the refresh interval as desired in milliseconds. The default refresh time interval is 500 seconds. You can set the refresh interval time window whatever you want by using the -t flag with nload. Let us set the refresh interval to 100 milliseconds with the following command:

Press Enter to run the nload -t command. The nload is the main command that will execute the further commands and flags associated with it. The -t flag is used to set the refresh interval time, and 100 milliseconds is the refresh time interval that needs to be set. See the following output:

These commands can be combined in just one command and analyze the traffic according to your need with only one command. Let’s say you want to set a time window to 200 and set the refresh time interval to 400 milliseconds. See the next command to learn how you can accomplish this.

Note that three flags -m, -a, and -t are provided at the same time. When this command completes its execution, it should show all the devices’ results at once while setting the window time to 200 seconds and refresh time interval to 400 milliseconds.

 

Conclusion

In this tutorial, we learned the need to monitor network traffic. We know about the nload tool provided in the Linux operating system used to monitor the network traffic. The nload is a command line tool that monitors the performance of network traffic by keeping an eye on the bandwidth. We also implemented some flags with the nload command to learn how the nload function and what kind of information it provides us.