Install the client on Ubuntu:

sudo apt update
sudo apt install mosquitto-clients


The client is now installed and can be stated to Listen on a Topic:

mosquitto_sub -h localhost -t test

or with username and password:

mosquitto_sub -h localhost -t test -u "sammy" -P "password"


Read more on https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-the-mosquitto-mqtt-messaging-broker-on-ubuntu-18-04