Bird
0
0

You ran chmod 777 myfile but ls -l myfile still shows -rw-r--r--. What is the most likely reason?

medium📝 Debug Q14 of 15
Linux CLI - File Permissions and Ownership
You ran chmod 777 myfile but ls -l myfile still shows -rw-r--r--. What is the most likely reason?
AYou forgot to run the command as root or with sudo
BThe file system is mounted as read-only
CThe chmod command syntax is incorrect
DThe file is a directory, not a file
Step-by-Step Solution
Solution:
  1. Step 1: Understand chmod effect and file system state

    chmod 777 should set full permissions. If permissions don't change, it may be due to file system restrictions like read-only mount.
  2. Step 2: Evaluate other options

    Running as root is not always required for own files. Syntax is correct. File type does not prevent permission changes. Read-only file system blocks changes.
  3. Final Answer:

    The file system is mounted as read-only -> Option B
  4. Quick Check:

    Read-only FS blocks chmod changes [OK]
Quick Trick: Check if filesystem is read-only if chmod fails [OK]
Common Mistakes:
  • Assuming sudo always needed
  • Blaming syntax without checking
  • Ignoring file system mount options

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes