Bird
0
0

You run touch newfile.txt but get an error: touch: cannot touch 'newfile.txt': Permission denied. What is the likely cause?

medium📝 Debug Q14 of 15
Linux CLI - File and Directory Operations
You run touch newfile.txt but get an error: touch: cannot touch 'newfile.txt': Permission denied. What is the likely cause?
AYou do not have write permission in the directory
BThe file newfile.txt already exists
CThe touch command is misspelled
DThe disk is full
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message

    The error says "Permission denied" which means the user lacks rights to create or modify files in the directory.
  2. Step 2: Check other options

    If the file exists, touch updates timestamp without error. Misspelling touch causes command not found, not permission denied. Disk full causes different errors.
  3. Final Answer:

    You do not have write permission in the directory -> Option A
  4. Quick Check:

    Permission denied = no write access [OK]
Quick Trick: Permission denied means no write rights in folder [OK]
Common Mistakes:
  • Assuming file existence causes permission error
  • Thinking touch command typo causes permission error
  • Ignoring directory permissions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes