Bird
0
0

You want to combine the contents of fileA.txt and fileB.txt into fileC.txt without overwriting fileC.txt if it exists. Which command is correct?

hard📝 Application Q9 of 15
Linux CLI - Viewing and Editing Files
You want to combine the contents of fileA.txt and fileB.txt into fileC.txt without overwriting fileC.txt if it exists. Which command is correct?
Acat fileC.txt > fileA.txt fileB.txt
Bcat fileA.txt fileB.txt > fileC.txt
Ccat fileA.txt fileB.txt >> fileC.txt
Dcat > fileC.txt fileA.txt fileB.txt
Step-by-Step Solution
Solution:
  1. Step 1: Understand redirection operators

    >> appends to a file, > overwrites it.
  2. Step 2: Choose the command that appends without overwriting

    cat fileA.txt fileB.txt >> fileC.txt uses >> to append contents of both files to fileC.txt.
  3. Final Answer:

    cat fileA.txt fileB.txt >> fileC.txt -> Option C
  4. Quick Check:

    Use >> to append, not overwrite [OK]
Quick Trick: Use >> to append file contents safely [OK]
Common Mistakes:
MISTAKES
  • Using > which overwrites
  • Misplacing filenames
  • Incorrect redirection syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes