Lesson 10 — File Permissions Basics
chmod + chown + ls -l
In Linux, many problems are not application failures at all. They are permission problems. This lesson teaches a clean troubleshooting flow using three core tools: ls -l to inspect permissions and ownership, chmod to change permission bits, and chown to change ownership. These are daily-use commands for junior admins, support technicians, and anyone working around Linux systems.
Good permission troubleshooting moves in order: inspect the file → identify who owns it → check read, write, execute bits → apply the smallest correct fix.
Read Linux permission strings, interpret owner and group, fix a script that will not run, and recognize when the problem is ownership instead of permission bits.
Lesson Objectives
By the end of this lesson
- Read the output of
ls -l - Understand owner, group, and other permissions
- Recognize what
r,w, andxmean - Use
chmodto adjust access - Use
chownto correct ownership
Why this matters
- A script can exist but still fail because it is not executable
- A user can have the right command but still lack ownership or write access
- Many “Linux is broken” problems are actually permission problems
1) Inspect Files with ls -l
Show permissions and ownership
Use ls -l to inspect permission bits, owner, group, and basic file details.
Read a real example
- – = regular file
- rwx = owner permissions
- r-x = group permissions
- r– = other permissions
- matt = owner
- staff = group
Understand the permission letters
Files often need read or write. Scripts and programs often need execute.
Do not guess. Before changing anything, inspect the file first. Good technicians verify the current owner and permissions before applying a fix.
2) Change Permissions with chmod
chmod changes permission bits. It is commonly used when a file is readable but not writable, or when a script exists but is not executable.
Simple execute fix
This adds execute permission, which is often required before a script can be run with ./scriptname.
Numeric permissions
755 usually means owner full access, group and others read/execute. 644 usually means owner read/write, group and others read only.
3) Change Ownership with chown
chown changes who owns a file. This matters when the wrong user or group controls the file.
Change file owner
This changes the owner of the file to the user named matt.
Change owner and group
This changes both the owner and the group.
Not every “permission denied” error is fixed with chmod. Sometimes the real issue is that the wrong user owns the file.
4) Fast Troubleshooting Pattern
When a user cannot open, edit, or run a file, use a simple sequence instead of random guessing.
- Inspect the file with
ls -l - Check who owns it
- Check whether the user needs read, write, or execute
- Use
chmodif the permission bits are wrong - Use
chownif the owner or group is wrong
Practical — Fix a Permission Problem
This practical teaches a real support workflow instead of just memorizing commands.
Practical Task
- Inspect a file with
ls -l - Decide whether the issue is missing execute permission or wrong ownership
- Apply either
chmodorchown - Verify that the file now behaves correctly
- Write one sentence describing what you found and what you fixed
Walkthrough
If the file exists but will not run, inspect the permission string first. If execute is missing, add it with chmod +x.
If the file is owned by the wrong user or group, correct ownership with chown.
Example Ticket Note
User could not execute backup script due to missing execute permission. Verified file permissions with ls -l, applied chmod +x, and confirmed successful execution.
Write Your Observation
Use a simple note like a junior admin or help desk tech would write.
Mini Knowledge Check
Score 75% or higher to unlock the next lesson link. Your score is saved on this browser.
1) Which command is best for viewing permissions and ownership in Linux?
2) What does the x permission mean?
3) Which command is commonly used to make a script executable?
4) When is chown the better fix than chmod?
Next Lesson
Tip: update the next lesson link when your page exists.