Linux Permissions on Linux for Beginners

File Permissions on Linux Explained for Absolute Beginners

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

File permissions on Linux can be confusing, especially when you see things like “rwx” and “644”. But what do they all mean? If you’ve ever been locked out of your file or encountered strange errors in the terminal, you’re not alone. I’ve been there, too. Let me show you how they work, and they won’t seem so intimidating anymore.

On Linux, permissions are assigned to each file and can be accessed by multiple users and groups. Invisible barriers are created by permissions to protect sensitive files and prevent execution of unauthorized commands.

In this guide, I’ll show you how Linux file permissions work, why they matter, and how you can manage them confidently, without breaking anything.

If you need help with Linux, I’ve got something that can help you right away!
Download my free Linux commands cheat sheet – it’s a quick reference guide with all the essential commands you’ll need to get things done on your system. Click here to get it for free!

Linux Permissions 101: What Are and Why They Exist?

Linux is a multi-user operating system. What does this mean? Well, that multiple people or programs acting as users can access the system simultaneously. File Permissions exist to control who can do what with each file or folder; without them, anyone could accidentally delete a sensitive file.

They’re also a powerful tool for sharing: permissions let you collaborate with others while keeping your files safe and untouched.

The 3 Linux Identities: User, Group, Others

Each file or directory on Linux is associated with three categories of users, and each category can have different levels of access:

  • User: This is typically the person who created the file. You’ll often see your username listed as the file’s owner.
  • Group: Each file belongs to a group, and each user is in a group. This allows multiple users in the same group to share access to a file.
  • Others: This refers to everyone else on the system, any user who is not the owner and not in the group.

You can test any of the following commands and examples in your own environment, only changing users in your terminal. You will know by trying to read or modify any file. You will know if the permissions work if it is possible to read or modify a file.

The 3 Types of Permissions: Read, Write, & Execute

Each user category (user, group, others) can be granted any combination of three permissions: read, write and execute. Each permission allows different actions for a file or directory:

PermissionFilesDirectories
Read (r)View file contentsList directory contents
Write (w)Edit or overwriteadd or remove files/folders
Execute (x)Run scripts or programsEnter the directory (cd)

For example, if a directory doesn’t have the x permission for your user, you won’t even be able to open it even if you can read its content.

Always Forgetting Linux Commands?
Grab This Cheat Sheet!
I've compiled the must-know commands in a simple PDF for quick reference.

Download now

Note: This is particularly useful if you automate scripts to run on startup using cron jobs, systemd or any similar methods.

Prefer reading without ads and popups?
Members get an ad-free version of every guide, plus exclusive project support.
Join the Community | Sign In

Understanding Permissions: Letters vs Numbers

You have probably seen different ways to view permissions from a file, in a symbolic and a numeric method. But what does each one mean? What are those strange combinations? Let’s see how it works.

Symbolic Format (rwxr-xr–)

While using the symbolic format, you’ll see characters representing each permission:

  • r = read
  • w = write
  • x = execute
  • – = no permissions

This is always represented in the following order: user, group, others. Let’s take a look at the following example:

You can gather all this information:

  • The file is owned by the user root.
  • The group is also root.
  • The permissions are:
    • rwx for the user owner, meaning he can read, write and execute.
    • rx for the group, meaning that any user on that group can read and execute.
    • rx for others, so anyone else can read and execute.

So in terms of permissions, only the root has all the permissions for the file, and the other users can only read and execute the file but not edit it.

Numeric Format (chmod 755)

Now, when you see only numbers (3 to be more specific), this means the permissions for each group are represented in numbers. Each permission is assigned a number:

  • r = 4
  • w = 2
  • x = 1

And the sum of each allowed action is the permission for each group, again, in the same order (user, group, others). Let’s take a look at an example using a permission 764.

There are other combinations, a lot of them, don’t worry you don’t have to memorize it, here’s a cheat sheet of the most important ones and what they do:

NumericSymbolicMeaning
777rwx rwx rwxFull access to everyone (Dangerous!).
755rwx r-x r-xComplete access to the user, but only read and write to the group and others (Great for scripts and executables).
644rw- r– r–Only read/write to user, and read to group and other (Default for documents and config).
700rwx — —Only access for the user.

Again, there are a lot of combinations. If you need something more specific, you can use a calculator to get the exact number for your permissions.

Always Forgetting Linux Commands?
Grab This Cheat Sheet!
I've compiled the must-know commands in a simple PDF for quick reference.

Download now

So, now you are probably thinking… which one should I use? Well, everything depends on when you’re using it. The numeric method is quicker for scripting or bulk changes, but symbolic is better for making specific permission changes on a file.

Useful Commands for Managing Permissions

Once you understand permissions, you’ll want to modify them. Here are the essential commands and how to use them.

ls – View File Permissions (Quick Overview)

The ls -l command lists files in a directory, showing permission symbols (like rwxr-xr–), owner, group, and more. This is the most common way to see the permission settings for your files or folders.

Example:
ls -l

You’ll see output like:
-rw-r--r-- 1 pi pi 4096 Jul 1 13:00 example.txt

This tells you the type (- for file, d for directory), permissions (rw-r–r–), owner (pi), group (pi), size, date, and filename.

Tip: Command lines can be a pain to memorize. I put the essential Linux commands on a printable cheat sheet so you don't have to keep googling them. You can grab the PDF here if you want to save some time.

stat – View Detailed File Permissions (Advanced)

stat gives more detailed information than ls, including the numeric (octal) permission value, last modification time, and more:
stat example.txt

Always Forgetting Linux Commands?
Grab This Cheat Sheet!
I've compiled the must-know commands in a simple PDF for quick reference.

Download now

The bottom line is what you want here, because you can see both symbolic and numeric permission formats.

chmod – Change File Permissions

chmod (change mode) lets you set new permissions using either numeric (e.g. 755) or symbolic (e.g. u+x) syntax. It works for files and directories.

Use numeric mode for fast, general changes:
chmod 755 script.sh

Or symbolic mode to modify permissions more precisely:
chmod u+x myfile.sh # Adds execute permission for the owner

This command is powerful, especially now that you already understand how to read and write permissions.

umask – Setting Default Permissions for New Files

umask defines the default “mask” or permission for new files and directories created by your user. It subtracts permissions from the system default (usually 666 for files, 777 for directories).

To view your current mask:
umask

To set a new one (temporary for the current session):
umask 022

This sets new files to 644 (rw-r–r–) and directories to 755 (rwxr-xr-x), which is a good secure default. But if you need something more specific, there’s a calculator that you can use effectively.

Always Forgetting Linux Commands?
Grab This Cheat Sheet!
I've compiled the must-know commands in a simple PDF for quick reference.

Download now

Note: Besides using umask, there are more tips that you can use to secure your Linux server, and it’s worth checking them out.

chown / chgrp – Change File Ownership

By default, the user who creates a file is its owner, and the file belongs to their primary group. But you can transfer ownership with these commands:

Change file owner:
sudo chown <new-user> file.txt

Change file group:
sudo chgrp <new-group> file.txt

Or do both at once:
chown newuser:newgroup file.txt

This is essential when you’re managing multiple users or correcting the ownership after transferring to another server.

But, if you need more commands, there are more of them that you can use for your specific cases.


🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Want to connect with other Raspberry Pi fans? Join the RaspberryTips Community. Ask questions, share your projects, and learn from each other. Join now.

Common Mistakes Beginners Make

Now, you already know the basics and commands for file permissions, but don’t get too cocky; there are a few common mistakes that beginners often make, so you must learn from these mistakes. The most common ones are:

  • Using chmod 777 on everything to “make it work” but weakening security.
  • Forgetting to add execute permission on scripts to make them run.
  • Not realizing that x (execute) is needed to access a directory.
  • Editing critical system files without checking your current permissions.
  • Assuming file ownership equals permission.

Once you understand how Linux handles file permissions, everything gets easier, from managing your files to administering servers. They’re not just about restriction, they give you precision, security and control.

Whenever you're ready, here are other ways I can help you:

Master Linux Commands: Overwhelmed with Linux commands? This book is your essential guide to mastering the terminal. It includes practical tips, real-world examples, and a bonus cheat sheet to keep by your side.

The RaspberryTips Community: Need help with Linux or want to chat with people who actually get it? Join the RaspberryTips Community and get access to private forums, exclusive lessons, and direct support.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts