###################### chmod ###################################################
chmod [options] mode file(s)
The chmod command in a terminal is used to change the permissions of files and
directories
-R: Applies the permission changes recursively to directories and their contents.
u: Represents the user/owner permissions.
g: Represents the group permissions.
o: Represents the permissions for other users.
a: Represents all users (equivalent to ugo).
The following symbols can be used to specify the permission actions:
+: Adds the specified permissions.
-: Removes the specified permissions.
=: Sets the specified permissions, overwriting existing permissions.
The permission types that can be assigned include:
Permission
-: No permission
r: Read permission.
w: Write permission.
x: Execute permission.
chmod u+rw,g+r,o-rwx myfile.txt
To specify permissions in octal notation, you use a three-digit number where each
digit represents the permissions for the owner, group, and other users,
respectively. Each digit is a sum of the following values:
0: No permission
4: Read permission.
2: Write permission.
1: Execute permission.
6 = 4 + 2
5 = 4 + 1
7 = 4 + 2 + 1
3 = 1 + 2
chmod 777 myfile.txt