The command chmod stands for change mode. It is used to change the permission of the file and folder. You can set the permissions by using the numeric and symbolic modes.
The permission controls the actions performed on the file or directory. There are three sets of permissions. The first one is for the owner of the file, the second one is for the members of the file's group, and the last one is for everyone (other).
Example: You are the owner of a file name file1.txt and you want to set its permission like below mentioned.
-> The user can read, write and execute it.
-> Members of the group can read and execute it.
-> Others can only read it.
Symbolic Form (Letter)
The command is chmod u=rwx,g=rx,o=r file.txt
u= user
g= group
o= other
r= read
w= write
x= execute
Numerical form (Octal Numbers)
chmod 754 file.txt
Here the digits 7, 5, and 4 each individually represent the permissions for the user, group, and others, in that order. Each digit combines the numbers 4, 2, 1, and 0. So 7 is the combination of permissions 4+2+1 (read, write, and execute), 5 is 4+0+1 (read, no write, and execute), and 4 is 4+0+0 (read, no write, and no execute).
4 = read
2 = write
1 = execute
0 = no permission