Bird
0
0

If you run this command in a terminal:

medium📝 Command Output Q5 of 15
Linux CLI - Linux Basics and Terminal
If you run this command in a terminal:
mkdir new_folder && cd new_folder

What is the result?
ADeletes 'new_folder' and stays in current directory
BCreates 'new_folder' and moves into it
COnly creates 'new_folder' but does not change directory
DShows an error because of incorrect syntax
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'mkdir' and 'cd'

    'mkdir new_folder' creates a directory; 'cd new_folder' changes into it.
  2. Step 2: Analyze '&&' operator

    '&&' runs second command only if first succeeds, so both happen sequentially.
  3. Final Answer:

    Creates 'new_folder' and moves into it -> Option B
  4. Quick Check:

    mkdir + cd with && = create and enter folder [OK]
Quick Trick: Use '&&' to run commands only if previous succeeds [OK]
Common Mistakes:
  • Thinking '&&' runs commands regardless of success
  • Confusing mkdir with delete commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes