LAB-PERM-01 - The Permission Trinity (rwx)
The Permission Trinity (rwx)
Read Linux permission strings confidently and explain what read, write, and execute mean for files versus directories.
- Read a basic permission string such as -rw-r--r-- or drwxr-xr-x.
- Explain how file permissions differ from directory permissions.
- Do all permission experiments in a practice area, not in important directories.
Part A: The Field Guide
When you run ls -l, the first block of characters tells you a lot about access.
Example:
-rw-r--r--
The pattern is:
- first character: what kind of thing this is
- next three: owner permissions
- next three: group permissions
- last three: other permissions
The first character
-means a regular filedmeans a directorylmeans a symbolic link
The three permission letters
rmeans readwmeans writexmeans execute or traverse-means that permission is missing
Important Distinction
On a file, x usually means the file can be run as a program or script. On a directory, x means you can enter or traverse the directory.
File versus directory behavior
For a file:
r: read the contentsw: change the contentsx: run the file if it is executable content
For a directory:
r: list names inside itw: create, rename, or remove entries inside itx: enter the directory or pass through it
Part B: The Drill Deck
Terminal required: keep everything in a harmless practice area.
G Guided Step by step - type exactly this and compare the result >
Exercise G1: Read one file permission string
- Run
ls -l /etc/passwd - Identify the file type character
- Read the owner, group, and other chunks out loud
- State what each chunk allows
Exercise G2: Read one directory permission string
- Run
ls -ld /tmp - Notice the leading
d - Explain why execute on a directory means traverse, not run
Exercise G3: Build your own example
- Run
mkdir -p ~/perm_lab && cd ~/perm_lab - Run
touch example.txt - Run
ls -l example.txt - Interpret the result in plain language
S Solo Task described, hints available - figure it out >
Exercise S1: Decode mentally
Explain these permission strings in plain language:
-rwxr-x---drwxrwxr-x-r--------
Exercise S2: Directory logic check
If a directory gives you read but not execute, what can you observe, and what can you not do? Answer in words before testing it later.
M Mission Real scenario - no hints, combine multiple skills >
Mission M1: Explain the directory case
In your own words, explain why deleting a file depends partly on the permissions of the directory that contains it, not just the file itself.
If you can explain that clearly, the permission model is starting to become real instead of memorized.