A GitHub user created a great speed test CLI script to interface with speedtest.net
Obtain the script:
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
Make the script executable:
chmod +x speedtest-cli
Now that we can execute the script the simplest operation is to run it. This will find the closest test server and provide you with download and upload speeds.
The Script can do so much more. Here are are some some examples.
List all Speedtest.net servers:
Use specific Speedtest.net servers (SERVER = server ID):
./speedtest-cli --server SERVER