Courseiva
Essential CommandseasyMultiple SelectObjective-mapped

LFCS Essential Commands Practice Question

Which TWO commands can be used to display the current working directory?

⚠ Common exam trap

Linux Foundation often tests the distinction between commands that display the working directory and commands that merely locate or describe other things, tricking candidates into selecting `which pwd` because it contains the letters 'pwd'.

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

pwd

The `pwd` command (B) is the standard POSIX command that prints the full pathname of the current working directory. The shell variable `$PWD` (D) is automatically set by the shell to the current working directory, so `echo $PWD` outputs the same path. Both are valid ways to display the current working directory.

Answer analysis

Option-by-option breakdown

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

  • which pwd

    Why it's wrong here

    Shows path of pwd command.

  • pwd

    Why this is correct

    Prints working directory.

  • date

    Why it's wrong here

    Shows date and time.

  • echo $PWD

    Why this is correct

    Prints PWD environment variable.

  • whoami

    Why it's wrong here

    Shows current username.

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.