List all python versions installed on CentOS / Linux / Unix

Method 1(Best Way):

Easy way is by executing the following command:

ls -ls /usr/bin/python*

You will get Output like this:

$ ls -ls /usr/bin/python*0 lrwxrwxrwx. 1 root root    7 Jun  5  2018 /usr/bin/python -> python20 lrwxrwxrwx. 1 root root    9 Jun  5  2018 /usr/bin/python2 -> python2.78 -rwxr-xr-x. 1 root root 7216 Apr 11  2018 /usr/bin/python2.7

Method 2: Use whereis command to get list of python installed in the system.

$ whereis pythonpython: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /usr/share/man/man1/python.1.gz