# File permission

### **File Permissions:**

In Unix-like systems, every file and directory has a set of permissions. These permissions are divided into three categories:

1. **User (u)**: The owner of the file.
    
2. **Group (g)**: The group associated with the file.
    
3. **Others (o)**: Everyone else.
    

For each category, there are three types of permissions:

1. **Read (r)**: Permission to read the file.
    
2. **Write (w)**: Permission to modify the file.
    
3. **Execute (x)**: Permission to execute the file (or traverse the directory).
    

For example, the permission set `rw-r--r--` means:

* The owner (user) can read and write but not execute (`rw-`).
    
* The group can only read (`r--`).
    
* Others can also only read (`r--`).
    

You can view the permissions of a file using the `ls -l` command and modify them using the `chmod` command.

### Commands

### **ls -l**

**\=&gt;** List all the files with their permission

\=&gt; In info it shows the file name, time, date, owner, group, and permissions

**chmod \[permission no\] file-name**

**\=&gt;** chmod 777 sumit.txt

**\=&gt;** use for change the permission

**. ls -l file-name**

**\=&gt;** ls -l sumit.txt

\=&gt; use to display only sumit.txt files permission
