Bird
0
0

Which command achieves this?

hard📝 Application Q15 of 15
Linux CLI - Pipes and Redirection
You want to run a script that outputs system info and save it to sysinfo.log while still seeing it live on screen. You also want to keep adding to the log without erasing old data. Which command achieves this?
Auname -a | tee sysinfo.log
Buname -a | tee -a sysinfo.log
Ctee -a sysinfo.log | uname -a
Duname -a > tee -a sysinfo.log
Step-by-Step Solution
Solution:
  1. Step 1: Understand the requirement to append and show output

    The command must show output on screen and append to the file without overwriting.
  2. Step 2: Identify correct tee usage

    uname -a | tee -a sysinfo.log uses tee -a sysinfo.log with pipe from uname -a, which appends and shows output live.
  3. Step 3: Eliminate incorrect options

    uname -a | tee sysinfo.log overwrites file. Options C and D misuse command order and redirection.
  4. Final Answer:

    uname -a | tee -a sysinfo.log -> Option B
  5. Quick Check:

    Pipe output to tee -a to append and show = A [OK]
Quick Trick: Use pipe and tee -a to append and display output live [OK]
Common Mistakes:
  • Forgetting -a causes overwrite
  • Placing tee before command
  • Using > redirection incorrectly with tee

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes