Bird
0
0

Which of the following is the correct syntax to copy file1.txt to file2.txt?

easy📝 Syntax Q3 of 15
Linux CLI - File and Directory Operations
Which of the following is the correct syntax to copy file1.txt to file2.txt?
Acp file1.txt/
Bcp file2.txt file1.txt
Ccp -r file1.txt file2.txt
Dcp file1.txt file2.txt
Step-by-Step Solution
Solution:
  1. Step 1: Understand basic cp syntax

    The syntax is cp source destination. So copying file1.txt to file2.txt is cp file1.txt file2.txt.
  2. Step 2: Check other options

    cp file2.txt file1.txt reverses source and destination. -r is for directories, not files. Ending with slash is invalid here.
  3. Final Answer:

    cp file1.txt file2.txt -> Option D
  4. Quick Check:

    Basic copy syntax = cp source destination [OK]
Quick Trick: cp source destination copies files [OK]
Common Mistakes:
  • Swapping source and destination
  • Using -r for files
  • Adding trailing slash to files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes