---
title: "How to Set File Permissions in Linux [+Example]"
description: "Here is a quick idea on how to set file permissions (read, write and execute) in Linux."
url: https://srinimf.com/2022/04/18/how-to-set-file-permissions-in-linux/
date: 2022-04-18
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2022/04/pexels-photo-9034968.jpeg?fit=1880%2C1253&ssl=1
categories: ["Linux"]
tags: ["Linux file permissions"]
type: post
lang: en
---

# How to Set File Permissions in Linux [+Example]

The command you need is ***chmod*** to change permissions in Linux. The Linux permission system works differently from Windows. We have some numbers associated with the permission.

1 – Execution

2 – Writing

4 – Reading

*File permissions Linux*

So you always have to make some math to apply for the permission. If you [want to](https://srinimf.com/2016/02/09/want-to-excel-in-ims-dc-programming-read-this/) assign the execution permission you can set as `1`, write permission `2` and reading permission `4`. `Write + Reading` is equal to `6`, so the permission is `6`. If you want `Read + Write + Execution` is equal to `7`. In the below section explained [how to](https://srinimf.com/2022/12/31/easy-ways-to-share-a-file-in-linux/) check file permissions.

## **[How to](https://srinimf.com/2022/12/03/how-to-write-echo-command-correctly-in-linux/) check file permissions**

```
alisson@devops:~$ touch new_file
alisson@devops:~$ ls -la new_file
-rw-rw-r-- 1 alisson alisson 0 Feb 20 19:21 new_file
```

The command touch is responsible to change the access time of any file. If the file does not exist, it creates one. Checking the output, you can see that we have the permissions: `read+write`, `read+write`, read, but what means that sequence:

```
user – group – other
```

In the same line, we can see `alisson alisson`, the first one is the user owner for this file and the second one is the group. By default, all the users created on Linux have a group with the same name as the user.

If you remember the numbers which represent the permission, we can make a calculation, `read+write = 4 + 2 = 6`. Then we have the following permissions:

```
664
```

Therefore, the user can read and write. Users from the same group can also read and write, users who do not belong to the group can just read.

Now, we can create a directory and analyze the permissions as we did just now:

## **[How to](https://srinimf.com/2014/08/02/analytics-how-to-make-mid-career-change/) check permissions for directory**

```
alisson@devops:~$ mkdir new_folder
alisson@devops:~$ ls -la | grep new_folder
drwxrwxr-x 2 alisson alisson 4096 Feb 20 19:29 new_folder
```

Analyzing the permissions, we can see, `read + write + execution` for the user and group, and `read + execution` for the others. If we [make the](https://srinimf.com/2012/02/08/1160/) following association:

```
read + write + execution = 4 + 2 + 1 = 7
read + execution = 4 + 1 = 5
```

So, whenever you give 777 that means, you are proving read + write + execution to user, group and owner.

## Command to change permissions

Use chmod command and associated numbers to change file permissions.

```
$ chmod 777 newfile
```

Related

- [How to Make Directory Sharable in Linux](https://srinimf.com/2022/12/31/easy-ways-to-share-a-file-in-linux/)DateDecember 31, 2022
- [How to Write a Script in K Shell](https://srinimf.com/2017/11/01/ksh-script-steps-to-create-awesome-way/)DateNovember 1, 2017
- [29 Top Linux Commands You Need Hands-on](https://srinimf.com/2017/03/17/the-best-unix-command-for-files/)DateMarch 17, 2017

- [![How to Find Databricks Job Status, Owner, and Active Runs Fast](https://i0.wp.com/srinimf.com/wp-content/uploads/2026/10/pexels-photo-30972899.jpeg?resize=867%2C1300&ssl=1)](https://srinimf.com/2026/10/17/databricks-find-job-status/) ## [How to Find Databricks Job Status, Owner, and Active Runs Fast](https://srinimf.com/2026/10/17/databricks-find-job-status/) Need to audit Databricks workflows? Step-by-step guide to tracking job creators, service principal run identities, and current execution status in Databricks.
- [![30 SQL Practice Queries with Solutions — Run Them Live](https://i0.wp.com/srinimf.com/wp-content/uploads/2026/10/pexels-photo-5530473.jpeg?resize=867%2C1300&ssl=1)](https://srinimf.com/2026/10/01/30-sql-practice-queries-with-solutions-run-them-live/) ## [30 SQL Practice Queries with Solutions — Run Them Live](https://srinimf.com/2026/10/01/30-sql-practice-queries-with-solutions-run-them-live/) Practice 30 SQL queries with solutions, from SELECT and JOINs to subqueries and window functions. Run SQL queries live in an interactive SQL Playground.
- [![Supercharge Your Database Skills: Try Our New Interactive SQL Plugin!](https://i0.wp.com/srinimf.com/wp-content/uploads/2026/09/pexels-photo-1181469.jpeg?resize=1880%2C1255&ssl=1)](https://srinimf.com/2026/09/30/supercharge-your-database-skills-try-our-new-interactive-sql-plugin/) ## [Supercharge Your Database Skills: Try Our New Interactive SQL Plugin!](https://srinimf.com/2026/09/30/supercharge-your-database-skills-try-our-new-interactive-sql-plugin/) Struggling with database queries? Explore our new interactive SQL plugin to write, test, and master SQL directly in your browser. Try the live demo now!

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2022%2F04%2F18%2Fhow-to-set-file-permissions-in-linux%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2022%2F04%2Fpexels-photo-9034968.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=How%20to%20Set%20File%20Permissions%20in%20Linux%20%5B%2BExample%5D)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2022/04/18/how-to-set-file-permissions-in-linux/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2022/04/18/how-to-set-file-permissions-in-linux/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2022/04/18/how-to-set-file-permissions-in-linux/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2022/04/18/how-to-set-file-permissions-in-linux/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20Set%20File%20Permissions%20in%20Linux%20%5B%2BExample%5D&body=https%3A%2F%2Fsrinimf.com%2F2022%2F04%2F18%2Fhow-to-set-file-permissions-in-linux%2F&share=email)
-

### Like this:

Like Loading…
