using speed test cli code example
Example 1: speed test cli
#for Ubuntu/ Debian
sudo apt-get install speedtest
#for mac:
brew tap teamookla/speedtest
brew update
brew install speedtest --force
Example 2: speedtest cli
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -