Who Controls Your Files in Linux? Discover the Power of Permissions 🔐

When working in a multi-user Linux environment, not everything is open to everyone—and that’s for a reason. File permissions are a cornerstone of Linux security, ensuring that only the right people can access or modify critical files. Whether you’re a …


This content originally appeared on DEV Community and was authored by Omkar Sharma

When working in a multi-user Linux environment, not everything is open to everyone—and that’s for a reason. File permissions are a cornerstone of Linux security, ensuring that only the right people can access or modify critical files. Whether you're a budding sysadmin or a curious developer, understanding how Linux handles file access is crucial to maintaining control and security.

Let’s break it down 👇

🔑 Introduction to File Permissions

Linux file permissions determine who can read, write, or execute files and directories. Each file or directory is governed by three levels of access:

  • Owner (User) – The creator of the file.
  • Group – Users who belong to the assigned group.
  • Others – Everyone else.

Permissions are represented in two ways:

  • Read (r or 4) – View file contents.
  • Write (w or 2) – Modify file contents.
  • Execute (x or 1) – Run the file as a program or script.

🛠️ Changing Permissions with chmod

🔹 Symbolic Mode

You can modify permissions using symbols:

  • + to add
  • - to remove
  • = to set exactly

Examples:

chmod u+x filename        # Add execute for user  
chmod g-w filename        # Remove write for group  
chmod o=r filename        # Set read-only for others  
chmod u=rwx,g=rx,o= filename  # Full for user, read/execute for group, none for others  

🔢 Numeric (Octal) Mode

Each permission has a value:

  • Read = 4
  • Write = 2
  • Execute = 1

Add the values to define access levels.

Examples:

chmod 755 filename  # User (rwx), Group (r-x), Others (r-x)  
chmod 644 filename  # User (rw-), Group (r--), Others (r--)  
chmod 700 filename  # User (rwx), No access for group/others 

👤 Changing Ownership with chown

The chown command is used to modify the file owner and group.

Examples:

chown newuser filename             # Change owner  
chown newuser:newgroup filename   # Change owner and group  
chown :newgroup filename          # Change only group  

Recursively change ownership:

chown -R newuser:newgroup directory/

👥 Changing Group Ownership with chgrp

To change only the group without affecting the owner:

Examples:

chgrp newgroup filename           # Change group  
chgrp -R newgroup directory/      # Recursively change group

🚀 Ready to Take Full Control of Your Files?

Linux file permissions may seem daunting at first, but with a little practice, they become second nature—and a powerful part of your system toolkit.

👉 Explore more of my Linux learning and projects on GitHub


This content originally appeared on DEV Community and was authored by Omkar Sharma


Print Share Comment Cite Upload Translate Updates
APA

Omkar Sharma | Sciencx (2025-05-04T12:36:11+00:00) Who Controls Your Files in Linux? Discover the Power of Permissions 🔐. Retrieved from https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/

MLA
" » Who Controls Your Files in Linux? Discover the Power of Permissions 🔐." Omkar Sharma | Sciencx - Sunday May 4, 2025, https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/
HARVARD
Omkar Sharma | Sciencx Sunday May 4, 2025 » Who Controls Your Files in Linux? Discover the Power of Permissions 🔐., viewed ,<https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/>
VANCOUVER
Omkar Sharma | Sciencx - » Who Controls Your Files in Linux? Discover the Power of Permissions 🔐. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/
CHICAGO
" » Who Controls Your Files in Linux? Discover the Power of Permissions 🔐." Omkar Sharma | Sciencx - Accessed . https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/
IEEE
" » Who Controls Your Files in Linux? Discover the Power of Permissions 🔐." Omkar Sharma | Sciencx [Online]. Available: https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/. [Accessed: ]
rf:citation
» Who Controls Your Files in Linux? Discover the Power of Permissions 🔐 | Omkar Sharma | Sciencx | https://www.scien.cx/2025/05/04/who-controls-your-files-in-linux-discover-the-power-of-permissions-%f0%9f%94%90/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.