The easiest way I’ve found to test my network speed from a command line is by using Speedtest CLI.
Click this link. -> Speedtest CLI and then click the button that says Ubuntu/Debian. Simply run the commands in the box to install it. When you’ve finished, you can run the speed test in a terminal with this command.
Easy enough right? The results will also provide you with a link so you can view the results in a browser if you wish.
If you want to just view the download and upload speed without all the extra stuff, you can use this. Note – This will not give you any visual confirmation that the test is running until the download/upload results are shown. Just give it a few seconds.