Bird
0
0

Which command correctly appends the output of date to a file named timestamps.log?

easy📝 Syntax Q3 of 15
Linux CLI - Pipes and Redirection
Which command correctly appends the output of date to a file named timestamps.log?
Adate >! timestamps.log
Bdate > timestamps.log
Cdate >> timestamps.log
Ddate >>> timestamps.log
Step-by-Step Solution
Solution:
  1. Step 1: Understand redirection operators

    > overwrites a file, >> is invalid, and >> is not standard syntax.
  2. Step 2: Identify append operator

    >> is invalid; >> is not recognized; >> is a typo. The correct append operator is > .
  3. Step 3: Choose correct command

    date >> timestamps.log appends output to the file without overwriting.
  4. Final Answer:

    date >> timestamps.log -> Option C
  5. Quick Check:

    Appending uses > [OK]
Quick Trick: Use >> to append output to a file [OK]
Common Mistakes:
  • Using > which overwrites the file
  • Using invalid operators like >>>
  • Confusing append with overwrite

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes