How to find Joomla or Drupal version from Linux CLI

The outdated versions can cause many security issues on the server. In order to prevent this issue at some level, it is necessary to keep your scripts updated.
If you have a server with number of sites running on it, it is difficult to find out accounts which are using outdated Joomla or Drupal . The below scripts helps you to find outdated versions of Joomla or Drupal on your server.

1- Joomla! 1/2/3 version and release:

Linux/cPanel:

find /home/*/public_html/ -type f \( -iwholename ‘*/libraries/joomla/version.php’ -o -iwholename 
‘*/libraries/cms/version.php’ -o -iwholename ‘*/libraries/cms/version/version.php’ \) 
-print -exec perl -e ‘while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if 
m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);’ {} \; && echo “-“

How to check WordPress outdated versions.

Linux/Plesk:

find /var/www/vhosts/*/httpdocs/ -type f \( -iwholename ‘*/libraries/joomla/version.php’ -o 
-iwholename ‘*/libraries/cms/version.php’ -o -iwholename ‘*/libraries/cms/version/version.php’ \) 
-print -exec perl -e ‘while (<>) { $release = $1 if m/ \$RELEASE\s+= .([\d.]+).;/; $dev = $1 if 
m/ \$DEV_LEVEL\s+= .(\d+).;/; } print qq($release.$dev\n);’ {} \; && echo “-“

2- Drupal version:

Linux/cPanel:

find /home/*/public_html/ -type f -iwholename “*/modules/system/system.info” -exec grep -H 
“version = \”” {} \;

Linux/Plesk:

find /var/www/vhosts/*/httpdocs/ -type f -iwholename “*/modules/system/system.info” -exec grep -H 
“version = \”” {} \;