Bird
0
0

A user types this command in terminal:

medium📝 Debug Q7 of 15
Linux CLI - Linux Basics and Terminal
A user types this command in terminal:
rm -r /home/user/docs

But accidentally deletes important files. What is a safer alternative?
AUse 'rm -rf /home/user/docs' to force delete quickly
BUse 'cp -r /home/user/docs /backup' to delete files
CUse 'mv /home/user/docs /tmp' to move files permanently
DUse 'rm -ri /home/user/docs' to confirm each file
Step-by-Step Solution
Solution:
  1. Step 1: Understand 'rm -r' risk

    'rm -r' deletes recursively without confirmation, risky for important files.
  2. Step 2: Use interactive mode

    'rm -ri' asks for confirmation before deleting each file, safer for accidental deletes.
  3. Final Answer:

    Use 'rm -ri /home/user/docs' to confirm each file -> Option D
  4. Quick Check:

    Safe delete = rm -ri [OK]
Quick Trick: Add -i to rm for confirmation before deleting [OK]
Common Mistakes:
MISTAKES
  • Using -rf which forces deletion without prompts
  • Confusing move with delete commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes