Bird
0
0

If you define alias rm='rm -i', what happens when you run rm file.txt?

medium📝 Command Output Q5 of 15
Linux CLI - Environment and Configuration
If you define alias rm='rm -i', what happens when you run rm file.txt?
AYou will be asked for confirmation before deleting the file
BThe file will be deleted immediately without prompt
CThe command will fail with an error
DThe file will be renamed to 'file.txt -i'
Step-by-Step Solution
Solution:
  1. Step 1: Understand the alias effect

    Alias changes rm to rm -i, which prompts before deleting files.
  2. Step 2: Predict command behavior

    Running rm file.txt triggers rm -i file.txt, asking for confirmation.
  3. Final Answer:

    You will be asked for confirmation before deleting the file -> Option A
  4. Quick Check:

    Alias rm='rm -i' = prompt before delete [OK]
Quick Trick: Alias can add safety prompts to commands [OK]
Common Mistakes:
  • Expecting immediate deletion
  • Thinking alias causes errors
  • Confusing alias with rename

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes