I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and
Here is a cleaner way to show them (technically without symbolic links):
ls -1 /usr/bin/python* | grep '[2-3].[0-9]$'
Where grep
filters the output of ls that that has that numeric pattern at the end ($).
Or using find
:
find /usr/bin/python* ! -type l
Which shows all the different (!
) of symbolic link type (-type l
).
compgen -c python | grep -P '^python\d'
This lists some other python things too, But hey, You can identify all python versions among them.
The more easy way its by executing the next command:
ls -ls /usr/bin/python*
Output look like this:
/usr/bin/python /usr/bin/python2.7 /usr/bin/pythonw
/usr/bin/python-config /usr/bin/python2.7-config /usr/bin/pythonw2.7