get version from command line

cd /var/www/vhosts/example.com
php -r "include 'app/Mage.php'; echo 'Magento version is: ', Mage::getVersion(); "

Another way:

su -l web_user -c "php bin/magento -V"