You can use this command to check the version of Hadoop:
$ hadoop version
Though, I am not sure whether you can get the Hive version from the command line. You can use something like the hive.hwi.war.file property or pull it out of the classpath.
If you want to learn Hadoop, I recommend this Hadoop Certification program by Intellipaat.
Also, check out this YouTube tutorial on Hadoop: