Bird
0
0

Which of the following is the correct syntax to remove a file named example.txt?

easy📝 Syntax Q12 of 15
Linux CLI - File and Directory Operations
Which of the following is the correct syntax to remove a file named example.txt?
Arm -i example.txt example2.txt
Brm -r example.txt
Crm example.txt
Drm -f
Step-by-Step Solution
Solution:
  1. Step 1: Identify basic rm syntax

    The basic command to remove a single file is rm filename. Here, rm example.txt removes the file named example.txt.
  2. Step 2: Understand option usage

    -r is for directories, -i asks for confirmation, and -f forces removal but needs a filename. rm example.txt is simplest and correct for a single file.
  3. Final Answer:

    rm example.txt -> Option C
  4. Quick Check:

    Basic rm syntax = rm filename [OK]
Quick Trick: Use rm filename to delete one file simply [OK]
Common Mistakes:
MISTAKES
  • Using -r for files instead of directories
  • Forgetting to specify filename
  • Using -f without filename

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes