Bird
0
0

You want to copy a file named report.txt to a directory /backup and preserve the file's timestamp. Which command is correct?

hard📝 Application Q15 of 15
Linux CLI - Linux Basics and Terminal
You want to copy a file named report.txt to a directory /backup and preserve the file's timestamp. Which command is correct?
Acp report.txt /backup -p
Bcp -p report.txt /backup
Ccp /backup report.txt -p
Dcp report.txt -p /backup
Step-by-Step Solution
Solution:
  1. Step 1: Recall cp command structure

    The command is 'cp', options come next, then source file, then destination directory.
  2. Step 2: Identify correct option placement

    '-p' preserves timestamps and must come immediately after the command, before arguments.
  3. Step 3: Validate each option

    cp report.txt /backup -p places '-p' after destination, which is incorrect. cp /backup report.txt -p reverses source and destination. cp report.txt -p /backup places '-p' between arguments, which is invalid.
  4. Final Answer:

    cp -p report.txt /backup -> Option B
  5. Quick Check:

    Command + options + source + destination [OK]
Quick Trick: Options always come right after the command [OK]
Common Mistakes:
  • Putting options after arguments
  • Swapping source and destination
  • Misplacing options between arguments

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes