Bird
0
0

You tried touch -c newfile.txt but the file was not created. Why?

medium📝 Debug Q7 of 15
Linux CLI - File and Directory Operations
You tried touch -c newfile.txt but the file was not created. Why?
AThe -c option tells touch not to create the file if it doesn't exist
BThe -c option creates a copy instead of a new file
CThe command syntax is incorrect
DThe file was created but hidden
Step-by-Step Solution
Solution:
  1. Step 1: Understand the -c option in touch

    The -c or --no-create option prevents touch from creating a new file if it does not exist.
  2. Step 2: Check why file was not created

    Since newfile.txt did not exist, touch did not create it due to -c option.
  3. Final Answer:

    The -c option tells touch not to create the file if it doesn't exist -> Option A
  4. Quick Check:

    -c prevents file creation = B [OK]
Quick Trick: -c option means no create, only update timestamps [OK]
Common Mistakes:
  • Thinking -c creates a copy
  • Assuming syntax error caused failure
  • Believing file was created but hidden

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes