In this lesson, we’ll explore how to view and modify file permissions and ownership on a Linux system. You’ll learn to inspect permission bits, change owners and groups, and apply both symbolic and numeric modes withDocumentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
chmod, chown, and chgrp.
Inspect Current Ownership and Permissions
Runls -l to display the owner, group, and permission bits for files and directories:
- Owner:
aaron - Group:
family - Permissions:
-rw-r-----
root) can change these settings.
Viewing and Changing Group Ownership
Usechgrp to assign a file or directory to a different group you belong to:
You can only switch a file’s group to one you’re already a member of.
Changing File Owner with chown
Onlyroot can change file owners. Prefix with sudo if necessary:
Understanding Permission Bits
The permissions string (-rwxrwxrwx) breaks down as:
- First character: file type
-= regular filed= directoryl= symbolic link
- Next nine: three triplets for owner, group, and others, each with
r(read),w(write), andx(execute).

Permission Effects
- Files
r: view contentsw: modify contentsx: execute (scripts or binaries)
- Directories
r: list entries (ls)w: create/delete entriesx: enter directory (cd)
Modifying Permissions with chmod
Use the symbolic syntax:| Reference | Meaning |
|---|---|
| u | owner (user) |
| g | group |
| o | others |
| a | all (u, g, o) |
| + | add permissions |
| - | remove permissions |
| = | set exact permissions |
Adding Permissions
Allow the owner to write:Removing Permissions
Remove the read bit for others:
Setting Exact Permissions
Grant group read-only:Combining References
You can comma-separate multiple adjustments:Numeric (Octal) Notation
To inspect the octal value, usestat:
rw- (6), group has r-- (4), others have --- (0) → mode 640.

r=4, w=2, x=1:
rwx= 4+2+1 = 7r-x= 4+0+1 = 5r--= 4+0+0 = 4
