Get Magento Version on the Command Line

If you just want to get the Magento version on the command line quickly try this one liner:

php -r "require 'app/Mage.php'; echo Mage::getVersion(); "

Does exactly what you need