220-1102 exam dumps

220-1102 practice question 236 of 828

A+ Core 2. Associate level, CompTIA. Free question with the correct answer and a full explanation.

220-1102 Question 236

Single answerpwd

A technician is connected to a Linux workstation through a remote shell and needs to confirm which directory the session is currently using before running a script that modifies files. Which command should the technician use?

  1. A

    pwd

  2. B

    cd

  3. C

    ls

  4. D

    mkdir

Show answer and explanation

Correct answer: A

Explanation

The best answer is pwd because its purpose is to display the shell's present working directory. In real support scenarios, especially over SSH or another remote terminal session, technicians should confirm their current path before executing scripts or file-management commands to avoid changing the wrong files. This aligns with standard Linux command-line usage documented in common shell manuals and the GNU core utilities, where pwd is specifically used to print the current directory path.

  • A. Correct.

    Correct. The pwd command prints the present working directory, showing the full path of the current directory for the shell session. This is the appropriate command to verify location before running commands that could affect files.

  • B. Incorrect.

    Incorrect. The cd command changes the current directory, but by itself it does not display the current working directory in the same direct way. A technician who is unsure of the current location should use pwd first.

  • C. Incorrect.

    Incorrect. The ls command lists the contents of a directory, typically the current one if no path is specified. While it may give clues about where the user is, it does not explicitly display the full current directory path.

  • D. Incorrect.

    Incorrect. The mkdir command creates a new directory. It does not provide information about the current working directory and would not help verify the present location before making changes.

Timed practice exam

Take a 220-1102 practice test under exam conditions

90 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam