Bird
0
0

What will be the output when you run the command echo -e "Line1\nLine2\nLine3" | more and press the spacebar once?

medium📝 Command Output Q4 of 15
Linux CLI - Viewing and Editing Files
What will be the output when you run the command echo -e "Line1\nLine2\nLine3" | more and press the spacebar once?
ADisplays only the first line and waits
BDisplays the first screen (all lines) and waits for next input
CDisplays all three lines at once
DDisplays nothing and exits immediately
Step-by-Step Solution
Solution:
  1. Step 1: Understand how more paginates output

    more shows one screen of output at a time and waits for user input to continue only if output exceeds the screen size.
  2. Step 2: Analyze the input lines and screen size

    Three lines fit within a standard terminal screen (~24+ lines), so more displays all lines immediately and exits without pausing.
  3. Final Answer:

    Displays the first screen (all lines) and waits for next input -> Option B
  4. Quick Check:

    Short output fits screen = displays all at once [OK]
Quick Trick: More shows one screen, spacebar moves forward [OK]
Common Mistakes:
  • Assuming it shows one line only
  • Thinking it exits immediately
  • Confusing spacebar with quit key
  • Expecting all output without pause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes