# Linux Fundamentals

In Ubuntu (and Linux in general), file permissions are represented by three characters: `r` (read), `w` (write), and `x` (execute). These permissions are assigned to three different categories of users: the owner of the file, the group associated with the file, and others (everyone else).

Each of these characters has a numeric equivalent, which is used when setting permissions via the `chmod` command.

Here are the values:

#### Permission Characters and Their Values

| Permission    | Symbol | Numeric Value |
| ------------- | ------ | ------------- |
| Read          | `r`    | 4             |
| Write         | `w`    | 2             |
| Execute       | `x`    | 1             |
| No Permission | `-`    | 0             |

#### Understanding the Numeric Representation

The permissions are represented by a 3-digit number (for user, group, and others). The number is a sum of the individual permissions, where:

* **Owner**: First digit (User permissions)
* **Group**: Second digit (Group permissions)
* **Others**: Third digit (Other users' permissions)

#### Common Permission Sets

Here are some common examples of permissions with their numeric equivalents:

| Permission  | Symbol | Numeric Value                                                  |
| ----------- | ------ | -------------------------------------------------------------- |
| `rwxrwxrwx` | 777    | Full permissions for everyone (owner, group, others)           |
| `rwxr-xr-x` | 755    | Owner can read/write/execute; group/others can read/execute    |
| `rw-r--r--` | 644    | Owner can read/write; group/others can read                    |
| `r--------` | 400    | Owner can read only                                            |
| `rwx------` | 700    | Owner can read/write/execute; group/others have no permissions |

Get the permissions back as in human readable format with :&#x20;

```
stat -c "%a" <filename>
```
