Bird
0
0

You want to create an alias cleanup that runs rm -rf ~/temp/* but want to be asked before deleting. Which alias is correct?

hard📝 Application Q8 of 15
Linux CLI - Environment and Configuration
You want to create an alias cleanup that runs rm -rf ~/temp/* but want to be asked before deleting. Which alias is correct?
Aalias cleanup='rm -i ~/temp/'
Balias cleanup='rm -rf ~/temp/*'
Calias cleanup='rm -r ~/temp/*'
Dalias cleanup='rm -ri ~/temp/*'
Step-by-Step Solution
Solution:
  1. Step 1: Understand rm options

    -r is recursive, -f is force (no prompt), -i is interactive (prompt).
  2. Step 2: Choose alias with prompt

    Only alias cleanup='rm -ri ~/temp/*' uses -ri to prompt before deleting recursively.
  3. Final Answer:

    alias cleanup='rm -ri ~/temp/*' -> Option D
  4. Quick Check:

    Use -i for prompt before delete [OK]
Quick Trick: Use -i with rm to confirm deletions [OK]
Common Mistakes:
  • Using -f which skips prompt
  • Missing recursive flag
  • Wrong path or syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes