Bird
0
0

You want to move all .txt files from folder1 to folder2 but avoid overwriting existing files in folder2. Which command should you use?

hard📝 Application Q15 of 15
Linux CLI - File and Directory Operations
You want to move all .txt files from folder1 to folder2 but avoid overwriting existing files in folder2. Which command should you use?
Amv -f folder1/*.txt folder2/
Bmv folder1/*.txt folder2/
Cmv -i folder1/*.txt folder2/
Dmv -r folder1/*.txt folder2/
Step-by-Step Solution
Solution:
  1. Step 1: Understand the goal

    You want to move all .txt files but be prompted before overwriting existing files in folder2.
  2. Step 2: Choose correct option

    The -i option asks for confirmation before overwriting. mv -i folder1/*.txt folder2/ uses mv -i correctly. mv folder1/*.txt folder2/ moves without prompt. mv -f folder1/*.txt folder2/ forces overwrite. mv -r folder1/*.txt folder2/ is invalid for files.
  3. Final Answer:

    mv -i folder1/*.txt folder2/ -> Option C
  4. Quick Check:

    Use -i to prompt before overwrite [OK]
Quick Trick: Use mv -i to confirm before overwrite [OK]
Common Mistakes:
  • Using -f which forces overwrite
  • Forgetting -i and overwriting silently
  • Using -r which is for directories

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes