Linux / Unix: Test Internet Connection Speed From SSH Command

Originally published at: https://www.cyberciti.biz/faq/linux-unix-test-internet-connection-download-upload-speed/

I have recently rented a dedicated server for my hobby projects and learning CentOS Linux server. I was informed that I am connected to the 100M/s port. How do I test my Internet connection download speed from the console over the ssh session without using HTML5 or Adobe flash/Java applets based websites? How do I test my upload speed from the console?

I use for this speedtest-cli and speedtest-csv tools. You can wget them from GitHub (or git clone them, or whatever you want to use to get them):
wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
wget -O speedtest-csv https://raw.githubusercontent.com/HenrikBengtsson/speedtest-cli-extras/master/bin/speedtest-csv
Chmod them in order to execute them, put them in your PATH and voila, you can test your net speeds from a command line, or in an automated manner as a cron job, with logging, notifying and all the bells and whistles.