From CLFS-HINTS
Introduction to chmod
The chmod command changes the mode, or permissions, of a file or directory. Permissions are set for the user, the group, and others in the order read (r), write (w), and execute (x). These permissions can be, and often are, set and represented by integers. You will see quite often in the CLFS book and the CBLFS Wiki the use of the integer format, especially when used with the [install] command. The permissions assigned by each integer is described in the table below.
| Permission | Binary | Decimal
|
| --- | 000 | 0
|
| --x | 001 | 1
|
| -w- | 010 | 2
|
| -wx | 011 | 3
|
| r-- | 100 | 4
|
| r-x | 101 | 5
|
| rw- | 110 | 6
|
| rwx | 111 | 7
|
As you can see, any possible permission setting for a entity can be represented by one decimal digit. Although there are a number of ways to combine the permission string for user, group, and others, it turns out that there are only a few that are used relatively often. These include:
| Permission | Binary | Decimal
|
| r--r--r-- | 100100100 | 444
|
| rw-r--r-- | 110100100 | 644
|
| rw-rw-rw- | 110110110 | 666
|
| rwxr-xr-x | 111101101 | 755
|
| rwxrwxrwx | 111111111 | 777
|
| --------- | 000000000 | 000
|