Bird
0
0

Which of the following is the correct syntax to create an empty file named notes.txt using touch?

easy📝 Syntax Q12 of 15
Linux CLI - File and Directory Operations
Which of the following is the correct syntax to create an empty file named notes.txt using touch?
Atouch notes.txt
Btouch -c notes.txt
Ctouch > notes.txt
Dtouch -r notes.txt
Step-by-Step Solution
Solution:
  1. Step 1: Identify the basic syntax of touch

    The basic command to create or update a file is touch filename. So touch notes.txt is correct.
  2. Step 2: Understand other options

    -c prevents creating a file if it doesn't exist, > is shell redirection (not touch syntax), and -r copies timestamps from another file.
  3. Final Answer:

    touch notes.txt -> Option A
  4. Quick Check:

    Basic touch syntax = touch filename [OK]
Quick Trick: Use simple: touch filename to create empty file [OK]
Common Mistakes:
MISTAKES
  • Using shell redirection instead of touch syntax
  • Adding unnecessary options like -c or -r
  • Confusing touch options with other commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes