To check the latest WordPress version:
curl -s https://wordpress.org/download/ |grep -Po 'The latest stable.+?\)'
Run where WordPress is installed:
cat wp-includes/version.php |grep "\$wp_version "
Mass check:
for i in `find . -name version.php`; do cat $i |grep "wp_version =" |cut -d"'" -f2; done find . -name version.php |xargs grep -r wp_version {} |egrep -v '4.9.6|\@global'