# ## Day6  Task: Permission Classes

## U -&gt; (owner)

### permission used for the owner of the file.

## G -&gt; (group)

### permission used by group members.

## O -&gt;(other)

### permission used by all other users.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690043494346/9420dfe4-b633-4ab2-9526-21b3a34b4a5f.png align="center")

---

## Permission Set:-

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690038684764/c49c69ad-e9c0-413e-af52-2378cd991c4b.png align="center")

| Permissions | Access for file | Access for Directory |
| --- | --- | --- |
| **Read** **(r)** | Display the file content and copy the file. | View the contents of the directory. |
| **Write (w)** | This means they can add, edit, or delete content within the file or folder. | Modify the contents of a directory. |
| **Execute (x)** | user to run or execute a file | Allow use of the **cd** command to access the directory |
| **File Type** | **"-"**This symbol represents a file | **"d"** This letter indicates that it is a directory. |

**File Type Examples:-**

**"-"**This symbol represents a file

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690043722237/3da4453f-3eeb-433e-a4f8-a040fa768555.png align="left")

**"d"** This letter indicates that it is a directory.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690043754087/1fccc257-d4fd-4b01-b3b1-4be01df149fd.png align="left")

---

## Permission with Numeric:-

### r -&gt; "r" stands for 4

### w -&gt; "w" stands for 2

### x -&gt; "x" stands for 1

When assigning permissions, you add up the numeric values for the desired permission types.

**For Example:-**

if you want to give a user read and write permissions.

you would use the numeric value 6 (4 for read + 2 for write).

| Symbol | Permission Type | Number |
| --- | --- | --- |
| **\- - -** | No Permission | 0 |
| **\- - x** | only Execute | 1 |
| **\- w -** | only write | 2 |
| **\- w x** | Write + Execute | 3 |
| **r - -** | only Read | 4 |
| **r - x** | Read + Execute | 5 |
| **r w -** | Read + Write | 6 |
| **r w x** | Read + Write + Execute | 7 |

The numeric representation is often used with the `chmod` command in Linux to set permissions for files and directories.

```java
chmod 777 <file_name.txt>
```

This means that read, write and execute permission is given to all the permission classes.
