If you are using Debian or Ubuntu operating system, install the speedtest application with the following command.
sudo apt-get install curl
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
sudo apt-get install speedtestafter installing run speedtest command