Courseiva
Essential CommandseasyMultiple SelectObjective-mapped

LFCS Essential Commands Practice Question

Which TWO commands can display the current environment variables?

⚠ Common exam trap

Watch out — candidates often confuse `set` (which shows all shell variables) with `env` (which shows only environment variables), or they think `echo $HOME` is a way to list all variables, when it only shows one specific variable.

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

env

The `env` command (option C) is correct because it displays all current environment variables along with their values. It is a standard Unix/Linux command specifically designed for this purpose, and it is commonly used in scripting and troubleshooting to inspect the environment.

Answer analysis

Option-by-option breakdown

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

  • set

    Why it's wrong here

    set displays all variables (shell and environment) and functions, which is more than environment variables alone.

  • echo $HOME

    Why it's wrong here

    This only displays the value of the HOME variable, not all environment variables.

  • env

    Why this is correct

    env displays all environment variables.

  • export

    Why it's wrong here

    export lists exported variables, but not all environment variables (non-exported ones are not shown).

  • printenv

    Why this is correct

    printenv displays all environment variables.

About these practice questions

One of 507 original LFCS 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.