This command is used to change file permissions. It can be used in two different ways. You can either give the group (u)ser,(g)roup,(o)thers followed by + or - then (r)ead, (w)rite, e(x)ecute. The first letter tells the command which group we would like to change the permissions of, the + or - tell the command whether we want to give or take away permissions and the second letter tells chmod which permissions we want to give or take away.
lightning:~>chmod uo+rx file.html
This command gives read and execute permissions to user and guest.
The other way to use this command is with the three digit number. The digits represent the user, group and world, respectively. To give the user read, write and execute permissions, you add up their corresponding numbers: read=4, write=2 and execute=1. The first digit of our three digit number would be 7. If we want to give the user's group no permissions, we would make the second digit 0. Finally, if we want to give the world read and execute permissions, we would add up 4 and 1 to get 5. The command is below:
lightning:~>chmod 705 home.html
This changes the permissions of the file home.html giving
the owner read, write and execute permissions, the group no permissions
and the world read and execute permissions.
You may check a file's permissions by used the -l flag with the ls command.