Run under the folder where Magento is installed
grep -A6 'static function getVersionInfo' app/Mage.php
Using bin/magento
php bin/magento --version
Notes
Run under the folder where Magento is installed
grep -A6 'static function getVersionInfo' app/Mage.php
Using bin/magento
php bin/magento --version