> For the complete documentation index, see [llms.txt](https://notes.mikaelsamvelian.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.mikaelsamvelian.com/linux-fundamentals/server-administration/file-permissions.md).

# File Permissions

On a Linux operating system, each file and directory is assigned access permissions for the owner of the file, the members of a group of related users and everybody else. This is to make sure that one user is not allowed to access the files and resources of another user.

![](/files/6X889or3XOfF5cfoPkj4)

![](/files/d2XVPPX7K6w4CNXeVEpX)

![](/files/QK22VFL8BcJ9Xaw6Z0ow)

#### Chmod command <a href="#chmod-command" id="chmod-command"></a>

The chmod command is used to modify files and directories permissions in Linux.

The chmod command accepts permissions in as a numerical argument. We can think of permission as a series of bits with 1 representing True or allowed and 0 representing False or not allowed.

| Permission              | rwx | Binary | Decimal |
| ----------------------- | --- | ------ | ------- |
| Read, write and execute | rwx | 111    | 7       |
| Read and write          | rw- | 110    | 6       |
| Read and execute        | r-x | 101    | 5       |
| Read only               | r-- | 100    | 4       |
| Write and execute       | -wx | 011    | 3       |
| Write only              | -w- | 010    | 2       |
| Execute only            | --x | 001    | 1       |
| None                    | --- | 000    | 0       |

Each digit is independent of the other two. Therefore, `750` means the current user can read, write, and execute, the group cannot write, and others cannot read, write, or execute.

`744`, which is a typical default permission, allows read, write, and execute permissions for the owner, and read permissions for the group and “world” users.

#### `664 => rw-rw-r--` <a href="#chmod-664-rw-rw-r" id="chmod-664-rw-rw-r"></a>

```
chmod 664 example.txt
```

\
**Chown command**

The chown command is used to change the owner of files or directories in Linux.

Command syntax: chown \\\<new\_owner> \\\<file\_name>

![](https://linkedin.github.io/school-of-sre/level101/linux_basics/images/linux/admin/image6.png)

**Chgrp command**

The chgrp command can be used to change the group ownership of files or directories in Linux. The syntax is very similar to that of chown command.

![](https://linkedin.github.io/school-of-sre/level101/linux_basics/images/linux/admin/image27.png)

Chgrp command can also be used to change the owner of a directory in the similar way.\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://notes.mikaelsamvelian.com/linux-fundamentals/server-administration/file-permissions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
