nerdexam
LPI

010-160 · Question #83

Which of the following commands shows the absolute path to the current working directory?

The correct answer is C. pwd. The pwd (print working directory) command outputs the absolute path of the current working directory.

Finding Your Way on a Linux System

Question

Which of the following commands shows the absolute path to the current working directory?

Options

  • Awho
  • Bcd ..
  • Cpwd
  • Dls -l
  • Ecd ~/home

How the community answered

(20 responses)
  • B
    5% (1)
  • C
    90% (18)
  • D
    5% (1)

Why each option

The `pwd` (print working directory) command outputs the absolute path of the current working directory.

Awho

`who` displays information about users currently logged into the system, not the current directory path.

Bcd ..

`cd ..` changes the current working directory to the parent directory; it does not display any path.

CpwdCorrect

`pwd` stands for 'print working directory' and always outputs the full absolute path from the filesystem root (e.g., /home/user/documents). It takes no arguments for basic use and is a POSIX-standard utility available on all Linux systems.

Dls -l

`ls -l` lists the contents of the current directory in long format but does not print the directory's own absolute path.

Ecd ~/home

`cd ~/home` attempts to change the working directory to a subdirectory called 'home' inside the user's home directory; it does not display a path.

Concept tested: Using pwd to display the current working directory

Source: https://man7.org/linux/man-pages/man1/pwd.1.html

Topics

#pwd#working directory#absolute path#navigation

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice