Bird
0
0

What will be the output on the screen and in the file result.txt after running this command?

medium📝 Command Output Q4 of 15
Linux CLI - Pipes and Redirection
What will be the output on the screen and in the file result.txt after running this command?
echo "Test" | tee result.txt
AScreen: (empty)<br>File result.txt: (empty)
BScreen: (empty)<br>File result.txt: Test
CScreen: Test<br>File result.txt: (empty)
DScreen: Test<br>File result.txt: Test
Step-by-Step Solution
Solution:
  1. Step 1: Understand tee output behavior

    tee writes input to both screen (stdout) and file.
  2. Step 2: Apply to given command

    Echo outputs "Test", tee sends it to screen and writes to result.txt.
  3. Final Answer:

    Screen: Test; File result.txt: Test -> Option D
  4. Quick Check:

    tee duplicates output to screen and file = Screen: Test
    File result.txt: Test [OK]
Quick Trick: tee shows output on screen and saves to file [OK]
Common Mistakes:
  • Assuming tee only writes to file
  • Thinking tee suppresses screen output
  • Confusing output redirection with tee

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes