Skip to content

Mastering File Permissions in Linux (Without the Headache)

If you’ve ever felt a little lost staring at output like -rwxr-xr--, don’t worry—you’re not alone. File permissions in Linux might look cryptic at first, but once you understand the logic behind them, they’re actually pretty simple. And more importantly, they’re your first line of defense in keeping your system secure.

Let’s break it down together, nice and easy.

The Basics: Who Can Do What?

Linux assigns permissions to three types of people (or rather, “categories”):

  • User (u) – the file’s owner (usually you).
  • Group (g) – users who belong to the file’s group (like teammates in a project).
  • Others (o) – everyone else on the system.

And for each of those, there are three possible actions:

  • Read (r) – look inside the file (or list a directory’s contents).
  • Write (w) – change the file (or add/remove files in a directory).
  • Execute (x) – run the file as a program (or enter a directory).

Still with me? Good. Let’s see what that looks like in real life.

Reading the ls -l Secret Code

Run ls -l in a terminal, and you might see something like this:

-rwxr-xr-- 1 user group 4096 Mar 12 10:00 example.txt

That first chunk – -rwxr-xr-- – tells the whole story. Here’s how to decode it:

PartMeans
-It’s a file (d would mean directory)
rwxUser can read, write, execute
r-xGroup can read and execute (but not write)
r--Others can only read

So in plain English: the owner has full control, the group can run it but not change it, and everyone else can just look at it.

Changing File Permissions in Linux with chmod

You have two ways to tweak permissions – and both work great. Pick whichever feels more natural.

1. Symbolic Notation (Letters)

Use + to add, - to remove, and = to set exactly.

  • Make the file executable for the user:
    chmod u+x example.txt
  • Take away write permission from the group:
    chmod g-w example.txt
  • Give others read‑only access (and nothing else):
    chmod o=r example.txt

You can even combine them: chmod u+x,g-w example.txt

2. Octal Notation (Numbers)

This one feels like a secret handshake at first, but it’s super efficient. Each permission has a number:

  • Read = 4
  • Write = 2
  • Execute = 1

Add them up for each category. For example, 7 (4+2+1) means read+write+execute.
5 (4+1) means read+execute.
4 alone means read‑only.

So chmod 751 example.txt means:

  • User gets 7 → read, write, execute
  • Group gets 5 → read and execute
  • Others get 1 → execute only

Much shorter than the symbolic way, right?

Double-Check Your Work

After changing permissions, always peek at the result:

ls -l example.txt

If it shows exactly what you wanted – great. If not, no worries, just run chmod again.

Wrapping Up (and a friendly tip)

Learning Linux permissions is one of those skills that pays off every single day – whether you’re securing a server or just making sure your roommate doesn’t accidentally delete your homework. 😄

Practice with a few test files, and soon enough you’ll be reading -rwxr-xr-- like a pro.

Happy coding – and happy permission‑tweaking!

Best Linux VPS Hosting in 2026

Best Linux VPS Hosting in 2026 (Compared for Developers)

A Linux VPS gives you your own isolated slice of a physical server — dedicated RAM, guaranteed CPU, …

Linux Kernel 7.1 Released

Linux Kernel 7.1 Released — New NTFS Driver, Intel FRED, and What’s New

Published: June 18, 2026 | Released June 14, 2026 | Covers desktop, gaming, and server impact Linux …

Secure Boot Linux 2026

Microsoft’s Secure Boot Certificates Expire June 27 — What Every Linux User Must Know

Secure Boot Linux 2026 has a deadline most users don’t know about. On June 27, 2026, Microsoft…

How to Set Up WireGuard VPN on Linux

How to Set Up WireGuard VPN on Linux (Server and Client, 2026)

Updated: May 2026 | Covers Ubuntu 26.04, 24.04, Debian, Fedora | Server + client + mobile setup Wire…

Origami Linux merges into RakuOS immutable distro

Origami Linux Is Dead — and That Might Be Great News for Immutable Linux

Published: June 2026 | Category: News & Analysis If you blinked last week, you might have missed…

How to Harden Your Linux System

How to Harden Your Linux System in 30 Minutes (Step-by-Step)

Skill level: Intermediate | Time to complete: 30–40 minutes | Tested on: Ubuntu 24.04, Debian 12, Fe…

Smart Home Automation Ideas for Beginners (2026)

Smart Home Automation Ideas for Beginners (2026): 10 Easy Setups That Actually Work

Private AI Knowledge Base with Local LLMs

How to Build a Private AI Knowledge Base with Local LLMs: A 2026 Step-by-Step Guide