Ubuntu (older than 20.04 LTS) ships with Python 3 and python 2 both. When python
was typed in terminal, python2.7 opens and to open python 3.6, python3
command is needed. However python3.6
also works.
So my doubt is why python3
and python3.6
both work? Technically since I have python3.6 installed, only python3.6
should work. But then why python3
works as well?
EDIT 1
When I type python
and press tabs twice (which shows possible commands), I see python3 and python3.8 both.
My doubt is what is the difference between the python3
command and python3.6
command in their execution.
The
python3
command is a link to whatever version of Py3 the system is currently using.This is very handy so scripts don't need to keep track of the exact version installed and don't break at the next release-upgrade.