Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-24-2008, 12:55 PM   #1
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 180

Rep: Reputation: 17
Command Line Bandwidth test?

This may be a stupid question, BUT...

Is there anyway to test bandwidth via command line? I have the need to verify bandwidth for remote locations but only have ssh access.
Old 03-24-2008, 02:24 PM   #2
LQ Newbie
Registered: Dec 2005
Location: Vancouver
Distribution: Debian/Ubuntu
Posts: 28

Rep: Reputation: 15


Maybe you are looking for something like this:


Old 03-24-2008, 03:05 PM   #3
Registered: Aug 2004
Location: Philadelphia,PA
Posts: 180

Original Poster
Rep: Reputation: 17
This looks like more of a network (LAN) interface monitoring tool. I am concerned with bandwidth to the internet and back (upload and download speeds).

Old 03-24-2008, 03:21 PM   #4
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 542

Rep: Reputation: 33
We've figured that with a 'test' file. Create a file which is representative (we used a 1/2 gig file and a 1 gig file) and transfer it back and forth between the sites in question. You could use SCP or FTP to transfer the files and simply use the time command or your watch to time the transfer. This worked for us to decide on the quickest way to transfer large files.
Hope this helps.
Old 02-11-2009, 12:01 PM   #5
LQ Newbie
Registered: Jan 2005
Location: Beirut - Lebanon
Distribution: Fedora
Posts: 18

Rep: Reputation: 0
For testing internet bandwidth (ie "slow" traffic), you can use tethereal, like that
tethereal eth1 -z conv,tcp
Wait for like 10 seconds, then hit ctrl-c, and you will get statistics about the amount of packets transferred... you might need to add up some numbers, then divide by the capture time
I know... ugly.. but hey, this is linux.
You could use time on the command, but remember that tethereal takes about a couple of seconds to start capturing, so that might not be very efficient.

For faster transfers, tethereal will start dropping packets. (check near the bottom, it says something like 151231 packets dropped if this happens. In this case the bandwidth measurement is not correct.

In this case you might want to use the method below:

For testing "pure" network performance (ie without considering the disk drive performance), you can do that.
Firs you will need a ram filesystem. I am running Knoppix now, so the /tmp/ directory is actually mounted in ram
go to one machine (receiving machine) and type

nc -l -p 12345 > /tmp/bwtest

then on the sending machine

time dd if=/dev/zero | nc 12345

( being the ip of the receiving machine)

wait for half a minute or so, then hit ctrl-c on the sending machine.
Now you have the time of transfer (real)
You can go on the receiving machine and type

ls -lh /tmp/bwtest

And you will get the amount of data received. Divide that by the time, and you get the bandwidth...

On a 100mbps eth crossover link between 2 machines running knoppix, i got 10 megabytes / second.

All the methods above use tools that are usually bundled with the OS.

Alternatively, there is a linux command line tool called iperf which may also provide bandwidth measurements.

Last edited by rozz; 02-11-2009 at 12:06 PM.
Old 09-22-2014, 07:46 AM   #6
LQ Newbie
Registered: Jul 2013
Posts: 18

Rep: Reputation: Disabled

Test Download/Upload Internet Speed in Linux
Use the following command to Test Internet Download and Upload Speed from the Linux Command Line :
$ wget -O - | python
Sample output :
Retrieving configuration...
Retrieving server list...
Testing from ******* (
Selecting best server based on latency...
Hosted by ******* [1.24 km]: 2.458 ms
Testing download speed...
Download: 84.35 Mbits/s
Testing upload speed...
Upload: 77.32 Mbits/s

I hope this will help :)
1 members found this post helpful.
Old 09-22-2014, 06:24 PM   #7
LQ Guru
Registered: Mar 2008
Posts: 13,891

Rep: Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773Reputation: 1773
It's always nice to test bandwidth close to how one might use it. For example, if system uses small ftp files then create a test based on small ftp. If large html then such.
Old 09-22-2014, 07:06 PM   #8
John VV
LQ Muse
Registered: Aug 2005
Posts: 15,893

Rep: Reputation: Disabled
"" is a good tool
I have been using it for some time

it is also IN "pip"
Old 09-22-2014, 07:34 PM   #9
Senior Member
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,487

Rep: Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627Reputation: 627
Originally Posted by firewallengineer View Post
Test Download/Upload Internet Speed in Linux
Use the following command to Test Internet Download and Upload Speed from the Linux Command Line :
That is my favorite way of speed testing as well. Sometimes I have to do it 24/7 in 15 minutes intervals. BUT I see you are using github as a test site. Which is using their bandwidth for no good reason. I do my speed tests downloading a large file from -yes -



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
command-line speed test zmeda Linux - Networking 5 09-22-2014 09:02 AM
howto print a test page from command line ? cccc Debian 1 05-18-2007 07:46 AM
how can i test bandwidth? yenonn Linux - Networking 1 04-15-2005 04:06 AM
Test internet bandwidth tangle Linux - Networking 1 04-13-2005 05:10 PM
bandwidth test arlothemoo General 0 12-13-2002 08:38 PM

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration