0% found this document useful (0 votes)
2 views3 pages

Chmod

The document explains how to use the chmod command in Linux to set file permissions using two methods: symbolic and numeric. The symbolic method uses letters to represent user, group, and others along with permission types (read, write, execute), while the numeric method utilizes octal values to define permissions. Examples are provided for both methods, illustrating how to add, remove, or set specific permissions for files.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Chmod

The document explains how to use the chmod command in Linux to set file permissions using two methods: symbolic and numeric. The symbolic method uses letters to represent user, group, and others along with permission types (read, write, execute), while the numeric method utilizes octal values to define permissions. Examples are provided for both methods, illustrating how to add, remove, or set specific permissions for files.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Using chmod for Standard

Permissions
In Linux, you can give permissions using chmod in two ways:

1. Symbolic (letter-based) method

2. Numeric (octal) method

1️⃣ Symbolic Method (u, g, o, a)


🔹 Who the permission applies to
u → user (owner)

g → group

o → others

a → all (u+g+o)

🔹 Permission symbols
r → read

w → write

x → execute

🔹 Operators
+ → add permission

→ remove permission

= → assign exact permission

📌 Examples

Using chmod for Standard Permissions 1


chmod u+r [Link]# Add read permission to owner
chmod g+w [Link]# Add write permission to group
chmod o-x [Link]# Remove execute permission from others
chmod a+r [Link]# Add read permission to everyone
chmod u=rwx [Link]# Set exact permissions for owner
chmod ug+rw [Link]# Add read & write to user and group

2️⃣ Numeric (Octal) Method


🔹 Permission values
Permission Value

Read (r) 4

Write (w) 2

Execute (x) 1

🔹 Common combinations
Number Permission

7 rwx (4+2+1)

6 rw- (4+2)

5 r-x (4+1)

4 r--

3 -wx

2 -w-

1 --x

0 ---

🔹 Order of numbers

Using chmod for Standard Permissions 2


OWNER GROUP OTHERS

📌 Examples
chmod 777 [Link]# rwx rwx rwx (full permissions)
chmod 755 [Link]# rwx r-x r-x
chmod 644 [Link]# rw- r-- r--
chmod 600 [Link]# rw- --- ---
chmod 700 [Link]# rwx --- ---

🔍 Check permissions
ls -l [Link]

Output example:

-rw-r--r-- 1 user group 1024 [Link]

Using chmod for Standard Permissions 3

You might also like