Speedtest-cli is a small command line application meant for testingyour internet speeds via Terminal in various Linux distributions including CentOS, Fedora, Ubuntu and Mint. Speedtest-cli uses thespeedtest.net website for testing your internet bandwidth. Installation is rather simple. Launch Terminal in your linux distribution and copy paste the following commands
# wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
# chmod +x speedtest_cli.py
Run an internet speed test with the following command:
# ./speedtest_cli.py

If you want to share the speed test result, you can use “–share” option, which will allow you to share speed test result with others in an image format via Speedtest.net.
# ./speedtest_cli.py --share

The following is a sample image automatically generated and uploaded to Speedtest.net by
speedtest-cli.

The utility supports a few other parameters, and you can view them by running the
speedtest-cli.py –help command.
# ./speedtest_cli.py --help
./speedtest_cli.py --help
Usage: speedtest_cli.py [options]
Command line interface for testing internet bandwidth using speedtest.net.
--------------------------------------------------------------------------
https://github.com/sivel/speedtest-cli
Options:
-h, --help show this help message and exit
--share Generate and provide a URL to the speedtest.net share
results image
--simple Suppress verbose output, only show basic information
--list Display a list of speedtest.net servers sorted by distance
--server=SERVER Specify a server ID to test against
--mini=MINI URL of the Speedtest Mini server
--source=SOURCE Source IP address to bind to
--version Show the version number and exit
Fuente: http://lintut.com/test-internet-speed-from-linux-command-line/