# File Permissions

> Rules for who may read, change or run a file on Linux.

**Field:** Infrastructure  
**Category:** Linux & the Command Line  
**Also known as:** Linux File Permissions, Unix Permissions, rwx Permissions

## Think of it like

Think of it like rules on a diary. The owner can write in it. Friends can read it. No one else can.

## Definition

File permissions are the rules for who may use a file on Linux. There are three kinds of right: read, write and run. They are set for three sets of people: the owner, the owner's group and everyone else. ls -l shows them as letters, like rwxr-x---. Each set can also be written as a number from 0 to 7.

## Example

Lucy's script shows rwxr-x---. She can read, change and run it. Her group can read and run it. Nobody else can touch it.

## Example code

```console
$ ls -l run.sh
-rwxr-x--- 1 lucy devs 120 Nov 16 09:30 run.sh
```

Three letters for the owner, three for the group and three for everyone else.

## Why it matters

They stop one user from reading or breaking the files of another. A broken app is held back too.

## Common mistake

Fixing an error by opening a file to everyone with 777. Anyone on the machine can then change it.

## Three principles

- **Read, write, run.** Three kinds of right.
- **Owner, group, others.** Three sets of people.
- **Least you need.** Give no more than the job needs.

## Related terms

- [chmod](https://learn.benibix.com/term/infrastructure/chmod)
- [chown](https://learn.benibix.com/term/infrastructure/chown)
- [User Group (Linux)](https://learn.benibix.com/term/infrastructure/user-group)
- [Root User](https://learn.benibix.com/term/infrastructure/root-user)
- [ls](https://learn.benibix.com/term/infrastructure/ls-command)

## Taught in

- [Linux File Permissions](https://learn.benibix.com/learn/infrastructure-linux/linux-file-permissions): Linux CLI, 6/10

![The line -rwxr-x--- lucy devs run.sh split into labelled parts. The first three letters rwx belong to the owner lucy and add up to 7. The next three r-x belong to the group devs and add up to 5. The last three dashes belong to everyone else and add up to 0. Under each letter, r is 4, w is 2 and x is 1.](https://learn.benibix.com/diagrams/inf3-permissions.svg)

---

Source: https://learn.benibix.com/term/infrastructure/file-permissions
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
