Courseiva
GNU and Unix Commands →mediumMultiple Choice

LPIC-1 GNU and Unix Commands Practice Question

Network Topology
$ pythonversion$ ls -l /usr/bin/python*Python 3.9.1$ file /usr/bin/python/usr/bin/python: symbolic link to python3

Refer to the exhibit. A user runs 'python --version' and gets 'Python 3.9.1'. Which command would run Python 2 instead?

⚠ Common exam trap

Test-takers frequently assume `python` always refers to Python 2, but the question shows it is Python 3, so they must recognize that `python2` is the explicit command for Python 2, not `python3` or a version flag.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

python2

On many Linux distributions, Python 2 and Python 3 are installed side by side, with the `python` command typically linked to Python 2 (or sometimes Python 3, depending on the distribution). However, in this scenario, `python --version` returns 'Python 3.9.1', indicating that `python` is linked to Python 3. To explicitly run Python 2, you must use the `python2` command, which is the standard binary name for Python 2.x installations.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    python --version2

    Why it's wrong here

    python --version2 passes --version2 as an argument to the Python 3 interpreter, which rejects it as an unrecognised option; no version selector exists in that form. It is tempting because appending a version number to a command looks like a selector, and versioned binary names such as python2 are the real mechanism.

  • ✓

    python2

    Why this is correct

    On most Linux distributions Python 2 and Python 3 are installed as separate interpreters, so the versioned binary name selects the major version. Invoking python2 runs the Python 2 interpreter, satisfying the requirement to use Python 2 rather than the default Python 3.9.1.

  • ✗

    python3

    Why it's wrong here

    python3 explicitly invokes the Python 3 interpreter, so it runs the same major version already reported, not Python 2. It is tempting because versioned interpreter names are the usual way to select a major version, and python3 would be correct when Python 2 is the default and Python 3 is required.

  • ✗

    python2 --version

    Why it's wrong here

    python2 --version only prints the installed Python 2 version string and exits; it never launches an interactive interpreter or executes a script. It is tempting because python2 is the genuine Python 2 binary, and invoking it with a script argument would correctly run code under Python 2.

About these practice questions

One of 402 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.