Back to Learn

Unix Permissions

Master chmod, chown, and access control

Unix Permissions: The Gatekeeper of Your Files

Every file and directory in Unix has permissions that control who can read, write, or execute it. Understanding permissions is essential for security and collaboration.

Why Permissions Matter

Security

Prevent unauthorized users from reading sensitive files like passwords, API keys, or private data.

Collaboration

Allow team members to access shared files while keeping personal files private.

System Integrity

Protect system files from accidental or malicious modification.

The Three Permission Targets

Unix groups users into three categories when checking file access:

Owner (u)

The user who owns the file. Usually the person who created it.

Group (g)

Users who belong to the file's assigned group.

Others (o)

Everyone else on the system who isn't the owner or in the group.

The Three Permission Types

r
Read
Files: View contents
Dirs: List contents
w
Write
Files: Modify contents
Dirs: Create/delete files
x
Execute
Files: Run as program
Dirs: Enter (cd into)

See It In Action

Click on a file below to select it. The ls -la command shows permissions, owner, group, and other metadata:

ls -la
$ls -la
permissionsownergroupsizemodifiedname
total 5,760

Reading the Permission String

-rwxr-xr-x
-
File type
- file, d directory, l link
rwx
Owner
Full access
r-x
Group
Read + execute
r-x
Others
Read + execute

Next up: Learn how these permissions translate to octal numbers like 755 and 644.