To do so, login to your server, head for the web project directory and run the following:
php -r "require 'app/Mage.php'; echo Mage::getVersion();"
This should output something similar to:
1.9.1.0
php -r "require 'app/Mage.php'; echo Mage::getVersion();"