Fundamentals 7 min read

Understanding Linux File Permissions, Ownership, and How to Use chown, chgrp, and chmod

This article explains Linux's multi‑user permission model, describing file type symbols, numeric and symbolic permission representations, and provides practical examples of using chown, chgrp, and chmod to manage file ownership and access rights.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
Understanding Linux File Permissions, Ownership, and How to Use chown, chgrp, and chmod

Linux is a multi‑user operating system where each user has distinct privileges, and file access permissions are enforced to protect system security.

File permissions are displayed with commands such as ls -l or ll , showing a ten‑character string where the first character indicates the file type (d for directory, - for regular file, l for link, b for block device, c for character device) and the remaining nine characters are three groups of rwx flags for owner, group, and others.

The numeric representation assigns r=4, w=2, x=1; each group’s permissions are summed to form a three‑digit octal code (e.g., 770 means rwx for owner and group, no permissions for others).

Ownership can be changed with chown (change owner) and chgrp (change group). Examples:

# chown bin install.log
# chown root:root install.log
# chgrp -R developers /var/www

Permission bits can be modified with chmod . Numeric mode:

# chmod 777 .bashrc
# chmod 754 file.txt

Symbolic mode uses u (owner), g (group), o (others), a (all) with +, -, = operators, e.g.,

# chmod u=rwx,g=rx,o=r myfile
# chmod a-x test1

Understanding these commands and the permission model is essential for system administration and security.

LinuxSystem AdministrationchgrpchmodchownFile Permissions
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.