Lesson 10 — File Permissions Basics (chmod, chown, ls -l)

CompTIA Cyber Path • Linux / Admin Basics • Lesson 10

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.

Core idea:

Good permission troubleshooting moves in order: inspect the fileidentify who owns itcheck read, write, execute bitsapply the smallest correct fix.

What you’ll be able to do:

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.

Linux basics chmod + chown ls -l local progress saved
Progress: 0%
Inspect Filels -l filename
Check Owner / Groupwho owns it?
Check Permission Bitsr, w, x
Apply Correct Fixchmod or chown
Good troubleshooting flow: What are the permissions?Who owns the file?Does the user need read, write, or execute?Use the smallest correct fix

Lesson Objectives

By the end of this lesson

  • Read the output of ls -l
  • Understand owner, group, and other permissions
  • Recognize what r, w, and x mean
  • Use chmod to adjust access
  • Use chown to 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.

ls -l

Read a real example

-rwxr-xr– 1 matt staff 1024 Mar 20 backup.sh
  • = regular file
  • rwx = owner permissions
  • r-x = group permissions
  • r– = other permissions
  • matt = owner
  • staff = group

Understand the permission letters

r = read w = write x = execute

Files often need read or write. Scripts and programs often need execute.

Important habit:

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

chmod +x backup.sh

This adds execute permission, which is often required before a script can be run with ./scriptname.

Numeric permissions

r = 4 w = 2 x = 1 chmod 755 backup.sh chmod 644 notes.txt

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

sudo chown matt config.txt

This changes the owner of the file to the user named matt.

Change owner and group

sudo chown matt:staff config.txt

This changes both the owner and the group.

Real-world habit:

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.

  1. Inspect the file with ls -l
  2. Check who owns it
  3. Check whether the user needs read, write, or execute
  4. Use chmod if the permission bits are wrong
  5. Use chown if the owner or group is wrong
ls -l backup.sh chmod +x backup.sh sudo chown matt:staff config.txt

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 chmod or chown
  • Verify that the file now behaves correctly
  • Write one sentence describing what you found and what you fixed

Walkthrough

ls -l backup.sh ./backup.sh chmod +x backup.sh ./backup.sh

If the file exists but will not run, inspect the permission string first. If execute is missing, add it with chmod +x.

ls -l config.txt sudo chown matt:staff config.txt

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

🔒 Locked until quiz ≥ 75% and you mark complete
Lesson 11 — Processes & Services Basics

Tip: update the next lesson link when your page exists.

Leave a Comment