Thursday, 18 September 2014

How to know the current network usage in linux



nload - Displays The Current Network Usage

nload is a console application which monitors network traffic and bandwidth usage in real time. It visualizes the in- and outgoing traffic using two graphs and provides additional info like
the total amount of transfered data and min/max network usage.

When running nload, you can switch between the devices (which you gave nload either on the command line or which were auto-detected) by pressing the left and right arrow keys. If the -m
command line parameter is given, the arrow keys switch as many devices back and forth as there are shown on the screen.

OPTIONS
A summary of the options supported by nload is included below.

-a period
Sets the length in seconds of the time window for average calculation. The default is
300.

-i max_scaling
Specifies the 100% mark in kBit/s of the graph indicating the incoming bandwidth usage.
Ignored if max_scaling is 0 or the switch -m is given. The default value for max_scaling
is 10240.

-m Show multiple devices at a time; do not show the traffic graphs.
-o max_scaling
Same as -i but for the graph indicating the outgoing bandwidth usage.

-t interval
Determines the refresh interval of the display in milliseconds. The default value of
interval is 500.

How to Install nload
Just open terminal /(Ctrl + Alt + t) and run the following command

$ sudo apt-get install nload

How to use it

Step 1: You can use nload by simply typing nload in the terminal, if you haven't provided any interface then it will display information for all network interfaces starting with eth0 (which is default). To Toggle between different network interfaces, use arrows keys or retrun key.
$ nload

1.

use arrow keys /return key. it goes.........

Decoding nload Output

Incoming: Data for incoming traffic:press return key
Curr: 23.53 kBit/s current, speed right now
Avg: 11.28 kBit/s average
Min: 33.67 kBit/s Minimum, in the observed period
Max: 0.28 kBit/s Maximum, in the observe period
Ttl: 14.34 GByte total volume transferred

Outgoing: Data outgoing traffic:
Curr: 56.29 kBit/s (same as above)
Avg: 56.24 kBit/s
Min: 44.77 kBit/s
Max: 79.67 kBit/s
Ttl: 982.78 MByte



Step 2: You can check specific network interface by specifying its name.

$ nload lo

Note: lo is a loopback network interface.
Step 3: You can check different network interfaces in same window by typing following command
$ nload -m lo ppp0




Step 4: nload uses bits/s as default unit to show traffic numbers, you can change it by specifying -u h|k|m. h - bits/s (Defualt) , k - kBits/s, m- Mbits/s.
$ nload -u k ppp0
 
Note: As you can see in the output, the total data field(Ttl) is still in Mbytes, You can change that field by using -U(capital) option.
$ nload -U k ppp0


Step 5: To know more about nload refer man page or use help command
$ man nload
$ nload --help
That's it.
I hope that you will enjoy it.
Try it some other command.
Comment it for you like.

1 comment: