Instead of going to sites like speedtest.net, I want to check my current Internet speed from the terminal on Ubuntu. How can I do it?

 

I recommend the speedtest-cli tool for this. I created a blog post (Measure Internet Connection Speed from the Linux Command Line) that goes into detail of downloading, installing and usage of it.

The short version is this: (no root required)

curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -

Output:

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Comcast Cable (x.x.x.x)...
Selecting best server based on ping...
Hosted by FiberCloud, Inc (Seattle, WA) [12.03 km]: 44.028 ms
Testing download speed........................................
Download: 32.29 Mbit/s
Testing upload speed..................................................
Upload: 5.18 Mbit/s

Update in 2018:

Using pip install --user speedtest-cli gets you a version that is probably newer than the one available from your distribution's repositories.

Update in 2016:

speedtest-cli is in Ubuntu repositories now. For Ubuntu 16.04 (Xenial) and later use:

sudo apt install speedtest-cli
speedtest-cli