Wondering how to check the version of Nodejs, Ansible, Ubuntu, PostgreSQL, Windows, Python and many more?
I believe there should be a standard way to check the version of all the software, but unfortunately, it doesn’t exist. I can guess it’s not possible as not every software is made from the same programming language.
Sometimes, it is a struggling moment to find out the software version installed on your server or PC.
Here I try to consolidate some of the popular ones, hope you will like it!
How to check the version of
Nginx
Checking Nginx version is easy.
nginx -v
Ex:
[email protected]:~# nginx -v
nginx version: nginx/1.14.0 (EasyEngine)
[email protected]:~#
Apache HTTP
Similar to Nginx, you can use -v
with httpd
file.
[[email protected] ~]# /usr/sbin/httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Nov 5 2018 01:47:09
[[email protected] ~]#
Change the httpd path to the actual where it is installed.
PHP
Similar to Nginx.
php -v
Ex:
[email protected]:~# /usr/bin/php -v
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.15-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
[email protected]:~#
Nodejs
Check nodejs version with --version
syntax like the following.
[[email protected] bin]# node --version
v6.16.0
[[email protected] bin]#
Python
Similar to Node.js, you can find out python version as below.
[[email protected] bin]# python --version
Python 2.7.5
[[email protected] bin]#
Anaconda
Using Anaconda platform for Python? Here is how you can find the Anaconda version. Assuming, you are running on UNIX-based OS.
[email protected]:~# conda list anaconda
# packages in environment at /root/anaconda3:
#
# Name Version Build Channel
anaconda 2018.12 py37_0
anaconda-client 1.7.2 py37_0
anaconda-navigator 1.9.6 py37_0
anaconda-project 0.8.2 py37_0
[email protected]:~#
If you just need to know the anaconda version then add $ at the end.
[email protected]:~# conda list anaconda$
# packages in environment at /root/anaconda3:
#
# Name Version Build Channel
anaconda 2018.12 py37_0
[email protected]:~#
Angular CLI
ng
with version
will show you the installed Angular CLI details.
[email protected]:~# ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 7.3.7
Node: 11.12.0
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.13.7
@angular-devkit/core 7.3.7
@angular-devkit/schematics 7.3.7
@schematics/angular 7.3.7
@schematics/update 0.13.7
rxjs 6.3.3
typescript 3.2.4
[email protected]:~#
PowerShell
On PowerShell command prompt, execute the following command to get the version.
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.2828
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2828
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PS C:\Windows\system32>
MySQL/MariaDB
Slightly different than PHP. To check the MySQL or MariaDB version, you have to use the following command.
mysql -V
Ex:
[email protected]:~# mysql -V
mysql Ver 15.1 Distrib 10.1.37-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
[email protected]:~#
PostgreSQL
To check the PostgreSQL client version
psql -V
And, to check the PostgreSQL server version
pg_config --version
Redis Server
By using -v
syntax.
redis-server -v
Java
Execute java with -version
and you will have the version details.
[[email protected] bin]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
[[email protected] bin]#
If you are trying to find java version the server and its not in the path, then you may have to give the absolute path to execute java.
Ubuntu
To check the ubuntu version, use the below command.
lsb_release -a
Ex:
[email protected]:~$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
[email protected]:~$
CentOS/RHEL
Wondering on which version of RHEL you are logged in? You can check the version by cat /etc/redhat-release
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[[email protected] ~]
Debian
Debian store the version information in a file which you can cat
to see.
[email protected]:~$ cat /etc/debian_version
9.8
[email protected]:~$
Linux Kernel
Sometime you may need to upgrade the kernel or setup a monitoring to ensure all servers are consistent. Whatever it is, you can find the kernel version with uname command as below.
[email protected]:~# uname -r
4.15.0-45-generic
[email protected]:~#
MacOS
If you need to find the MacOS version, then click on Apple icon and >> About This Mac
Windows
I know what you are feeling. C’mon everyone knows how to check this. But trust me, not really.
There are multiple ways to find so let’s look at the two most common procedure.
Using Command
- Launch Command Prompt
- Type
winver
and press Enter
This PC
- Go to start and search for This PC
- Right click on This PC and Properties
- It will open the system window where you will find the OS version and other information like type of computer/server, model, processor, RAM, manufacturer, etc.
Tomcat
Apache Tomcat has a dedicated version file which you will find under bin
folder. You just need to execute that to find out the Tomcat version.
[[email protected] bin]# ./version.sh
Using CATALINA_BASE: /root/apache-tomcat-9.0.16
Using CATALINA_HOME: /root/apache-tomcat-9.0.16
Using CATALINA_TMPDIR: /root/apache-tomcat-9.0.16/temp
Using JRE_HOME: /
Using CLASSPATH: /root/apache-tomcat-9.0.16/bin/bootstrap.jar:/root/apache-tomcat-9.0.16/bin/tomcat-juli.jar
Server version: Apache Tomcat/9.0.16
Server built: Feb 4 2019 16:30:29 UTC
Server number: 9.0.16.0
OS Name: Linux
OS Version: 3.10.0-957.5.1.el7.x86_64
Architecture: amd64
JVM Version: 1.8.0_191-b12
JVM Vendor: Oracle Corporation
[[email protected] bin]#
WildFly
You can either check using command or through the management console.
For the command line, you need to run the following.
./standalone.sh --version
And, it will print like this.
20:05:44,496 INFO [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final
WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final)
Another way is to log in to the management console and click on version details on the bottom bar.
WordPress
There are multiple ways to find out the installed WP version.
When you log in to WordPress, you will notice the version details on the bottom right.
Google Chrome
Wonder what version of Chrome you are having? Often needed if you are talking to technical support guys or performing some troubleshooting.
Well, it’s not hard to find the chrome version.
- Launch Chrome
- Click on three dots at top right
- Hover to Help and click About Google Chrome to see the version details
Internet Explorer (IE)
You know the major version but do you know the complete version?
- Launch IE
- Go to Tools icon and click About Internet Explorer
- And, it will show you the version information.
Well, now you know!
Firefox
Clicking on About Firefox would reveal the version you are using.
apt-get
As a Linux administrator, you might have come across apt-get (package handling tool). Sometimes you are installing a tool which is not compatible with the current apt-get
installed and to find out the version; you can run the below command.
[email protected]:~# apt-get -v
apt 1.6.8 (amd64)
Supported modules:
*Ver: Standard .deb
*Pkg: Debian dpkg interface (Priority 30)
Pkg: Debian APT solver interface (Priority -1000)
Pkg: Debian APT planner interface (Priority -1000)
S.L: 'deb' Debian binary tree
S.L: 'deb-src' Debian source tree
Idx: Debian Source Index
Idx: Debian Package Index
Idx: Debian Translation Index
Idx: Debian dpkg status file
Idx: Debian deb file
Idx: Debian dsc file
Idx: Debian control file
Idx: EDSP scenario file
Idx: EIPP scenario file
[email protected]:~#
As you can see it shows the version and its supported module.
gcc
Often you are trying to upgrade or install the latest version of the software, and you need to find out the compiler version to see if it is compatible. But finding gcc
version is easy!
[email protected]:~# gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[email protected]:~#
Ansible
--version
would show you the installed Ansible version.
[email protected]:~# ansible --version
ansible 2.7.9
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]
[email protected]:~#
TensorFlow
It depends on how you have installed. Assuming, you have done it through pip then the following command will show the TensorFlow version details.
[email protected]:~# pip show tensorflow
Name: tensorflow
Version: 1.13.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /root/anaconda3/lib/python3.7/site-packages
Requires: termcolor, absl-py, wheel, protobuf, tensorboard, gast, six, tensorflow-estimator, numpy, keras-preprocessing, grpcio, keras-applications, astor
Required-by:
[email protected]:~#
Brew
A standard -v
syntax would reveal installed brew version.
Chandans-iMac:~ chandan$ brew -v
Homebrew 2.0.2
Homebrew/homebrew-core (git revision 903f; last commit 2019-03-02)
Chandans-iMac:~ chandan$
Docker
Executing docker
command with -v
will show you the version.
[email protected]:~# docker -v
Docker version 18.09.3, build 774a1f4
[email protected]:~#
Conclusion
I hope this helps you to find the software versions. Let me know if you want to get some more added.