Bird
0
0

What will be the output of the following commands?

medium📝 Command Output Q13 of 15
Linux CLI - Linux Basics and Terminal
What will be the output of the following commands?
mkdir testdir
cd testdir
pwd
A/testdir
B/home/testdir
C/home/username/testdir
Dtestdir
Step-by-Step Solution
Solution:
  1. Step 1: Understand the commands

    mkdir testdir creates a folder named testdir. cd testdir moves into that folder. pwd prints the full path of the current directory.
  2. Step 2: Determine the full path

    Assuming the user starts in their home directory (like /home/username), after changing into testdir, pwd will show /home/username/testdir.
  3. Final Answer:

    /home/username/testdir -> Option C
  4. Quick Check:

    pwd after cd into testdir = full path /home/username/testdir [OK]
Quick Trick: pwd shows full path, not just folder name [OK]
Common Mistakes:
  • Expecting just folder name output
  • Assuming root directory path
  • Confusing relative and absolute paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes