Fundamentals 7 min read

Master Linux File Permissions: chown, chmod, and Permission Bits Explained

This guide explains how Linux manages file ownership and access rights, covering the use of chown and chmod commands, interpreting ls -l output, numeric and symbolic permission representations, and practical examples for changing owners, groups, and permission bits.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux File Permissions: chown, chmod, and Permission Bits Explained

Linux is a multi‑user operating system where each user has distinct privileges. To protect system security, Linux defines separate access rights for different users on the same file or directory.

The two primary commands for modifying file ownership and permissions are chown (change owner) and chmod (change mode).

Use ls -l or ll to view a file’s attributes, including its type and permission bits. The first character indicates the file type (d for directory, - for regular file, l for symbolic link, etc.). The next nine characters are three groups of rwx representing read, write, and execute permissions for owner, group, and others.

Permission bits can be expressed numerically: r=4, w=2, x=1. The sum of each group yields a three‑digit number such as 770 (owner = 7, group = 7, others = 0). The symbolic form chmod u=rwx,g=rx,o=r filename sets the same permissions.

Changing ownership is done with chown (e.g., chown bin install.log) or chown root:root install.log. Changing the owning group uses chgrp, optionally with -R for recursive changes.

Examples:

# ls -l

drwxr-xr-x 2 root root 4096 Dec 14 2012 bin
...
# chown bin install.log
# chmod 777 .bashrc
# chmod u=rwx,g=rx,o=r test1

Images illustrate the permission string layout and the mapping of characters to numeric values.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxUnixchmodchownFile Permissions
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

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.