Bird
0
0

You want to safely delete all files with extension .log in your current folder, but want to confirm each deletion. Which command should you use?

hard📝 Application Q15 of 15
Linux CLI - File and Directory Operations
You want to safely delete all files with extension .log in your current folder, but want to confirm each deletion. Which command should you use?
Arm -f *.log
Brm -r *.log
Crm *.log
Drm -i *.log
Step-by-Step Solution
Solution:
  1. Step 1: Identify the need for confirmation

    You want to confirm each file deletion, so the -i option is needed.
  2. Step 2: Use wildcard for all .log files

    The pattern *.log matches all files ending with .log in the current folder.
  3. Step 3: Combine options correctly

    Using rm -i *.log will ask for confirmation before deleting each .log file.
  4. Final Answer:

    rm -i *.log -> Option D
  5. Quick Check:

    Confirm each deletion = rm -i [OK]
Quick Trick: Add -i to confirm each file deletion with wildcard [OK]
Common Mistakes:
  • Using rm without -i deletes without confirmation
  • Using -r unnecessarily for files
  • Using -f forces deletion without asking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes