Chmod

From CLFS-HINTS

Jump to: navigation, search
man page: http://www.die.net/doc/linux/man/man1/chmod.1.html

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.

PermissionBinaryDecimal
--- 000 0
--x 0011
-w- 0102
-wx 0113
r-- 1004
r-x 1015
rw- 1106
rwx 1117

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:

PermissionBinaryDecimal
r--r--r-- 100100100444
rw-r--r-- 110100100644
rw-rw-rw- 110110110666
rwxr-xr-x 111101101755
rwxrwxrwx 111111111777
--------- 000000000000
Personal tools