Bird
0
0

You want to copy all files and folders from project/ to backup/, but only if the files in backup/ are older than those in project/. Which command achieves this?

hard📝 Application Q15 of 15
Linux CLI - File and Directory Operations
You want to copy all files and folders from project/ to backup/, but only if the files in backup/ are older than those in project/. Which command achieves this?
Acp -ru project/ backup/
Bcp -r project/ backup/
Ccp -rf project/ backup/
Dcp -ri project/ backup/
Step-by-Step Solution
Solution:
  1. Step 1: Understand the options

    -r copies directories recursively, -u copies only when source is newer than destination, -f forces overwrite, -i prompts before overwrite.
  2. Step 2: Choose the correct combination

    To copy directories and update only newer files, use -ru. This copies recursively and updates only if source is newer.
  3. Final Answer:

    cp -ru project/ backup/ -> Option A
  4. Quick Check:

    Use -ru to copy recursively and update only newer files [OK]
Quick Trick: Use -ru to copy folders and update only newer files [OK]
Common Mistakes:
  • Using -r alone copies all files regardless of age
  • Using -f overwrites without checking timestamps
  • Using -i prompts but doesn't check file age

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes