Master Linux File Permissions: Symbolic & Numeric chmod Guide
This article explains Linux file permission concepts, the meaning of permission bits, file types, how to interpret ls -l output, and provides practical examples of using chmod in both symbolic and numeric modes to control access for owners, groups, and others.
Introduction
Linux assigns three basic access modes—read, write, and execute—to each file. These permissions are applied to three categories of users: the file owner, members of the owner’s group, and all other users.
File Types and Permission Bits
When a directory is listed with ls -l (or ll), the first column shows a 10‑character string such as drwxr-xr-x. The first character indicates the file type: d – directory l – symbolic link - – regular file s – socket b – block device c – character device p – FIFO (named pipe)
The remaining nine characters are three groups of rwx, representing read, write, and execute permissions for the owner, the group, and others respectively. A dash ( -) means that particular permission is not granted.
Interpreting ls -l Output
[root@VM_0_14_centos ~]# ll
total 32
drwxr-xr-x 4 root root 4096 Nov 28 00:09 group-chat
-rwxr--r-- 1 root root 2303 Sep 17 11:31 start_sb_app.sh
...Key fields:
total 32 – total size of files in the directory (in blocks)
drwxr-xr-x – file type and permission bits
4 – number of hard links
root – owner name
root – group name
4096 – file size in bytes
Nov 28 00:09 – last modification timestamp
group-chat – file or directory name
Changing Permissions with chmod
Symbolic mode
General syntax: chmod [who]operator[permission] filename who can be: u – owner g – group o – others a – all (owner, group, others)
operator can be: + – add permission - – remove permission = – set exact permission (clears unspecified bits)
permission letters: r – read w – write x – execute
Examples (assuming myfile initially has rwxrwxrwx): chmod a-x myfile → rw-rw-rw- (remove execute from everyone) chmod go-w myfile → rw-r--r-- (remove write from group and others) chmod u+x myfile → rwxr--r-- (add execute for the owner)
Numeric (absolute) mode
Permissions can also be expressed as three octal digits. Each digit is the sum of read (4), write (2), and execute (1) bits for owner, group, and others.
Examples: chmod 777 myfile → rwxrwxrwx (full access for everyone) chmod 644 myfile → rw-r--r-- (owner read/write, group and others read only) chmod 444 myfile → r--r--r-- (read‑only for all users)
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
