Symbolic and octal chmod
Quick answer
Use chmod to express the access you actually intend. Symbolic modes change selected permissions; octal modes specify the numeric bit pattern for ordinary permission bits.
Prepare the practice environment
Use the chapter fixture described in lab-fixtures/permissions/README.md. Run setup as a normal user in a disposable Linux environment, enter the printed directory, check pwd, and run export LC_ALL=C; umask 022. Every example assumes a fresh fixture. Commands omit the terminal prompt; outputs below are not commands.
How it works
Each ordinary octal digit is read=4, write=2, execute=1. For example 640 is owner rw (6), group r (4), other none (0). Symbolic classes are u, g, o and a; operators + add, - remove and = replace the selected permissions. Explicit classes avoid umask-dependent behavior when a class is omitted. For ordinary regular files, 600 grants only owner read/write. Directory modes need search for usable access; special bits are covered later. chmod requires ownership or appropriate privilege and is not an ownership command.
Starting with a regular file at 0644, chmod g+w report.txt produces 0664: the original owner and other bits remain. In contrast, chmod 600 report.txt sets the ordinary mode to owner read/write only. When diagnosing an unexpected mode, record it first, choose the intended change, then inspect the final mode rather than assuming success from silence.
Try the examples
A private ordinary file need not be executable.
Expected stdout:
600 -rw-------Other bits are preserved; the fixture starts at 640.
Expected stdout:
600chmod u+x demo.shstat -c %a demo.sh./demo.shThe synthetic script starts at 600; executing a script also requires a usable interpreter and execution policy.
Expected stdout:
700helloCommon mistakes
Avoid broad 777 and recursive chmod as troubleshooting shortcuts. A regular data file usually does not need execute permission. Check existing modes and use the smallest necessary change.
Practice
Change report.txt to 660, verify, then remove group write with g-w; explain the resulting 640.
Related references
Study: chmod. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Symbolic and octal chmod — Knowledge Check
Apply the lesson concepts to the controlled permission fixture.
What does 640 mean?
What does g-w do?
Which mode is a private read/write regular file?
Which statement about chmod is true?