To use this script, please use these commands in this order.
sudo nano ~/.bashrc
Then at the end of the file, enter the following line:
alias speedtest="sudo mkdir -p /share/speedtest && sudo curl https://raw.githubusercontent.com/RogueEmailing/cli-speedtest/main/speedtest | sudo python - --share --secure | sudo dd -of =/share/speedtest/result && echo You can view the result in this file: /share/speedtest/result"
Next you will need to type these commands:
sudo source ~/.bashrc
Now to run the speedtest whenever you need, you just type:
sudo speedtest
Now you are able to run a speedtest directly from your CLI on Linux.