How to find Joomla WordPress or Drupal version from Linux CLI

I was about to rewrite some of these queries again, and decided to google instead. I found this page with them already written: http://kb.iweb.com/entries/29801848-Verifying-CMS-versions-on-multiple-websites