Datasheet
Task 1.2: Manage Files and Directories
15
The second column in Table 1.1 provides an octal (base-8) code corresponding to the per-
mission string. Each cluster of three permission bits can be represented as a 3-bit number,
which in turn can be represented as a single octal number from 0 to 7. Read permission cor-
responds to 4, write permission corresponds to 2, and execute permission corresponds to 1.
Add the permissions you want to obtain the corresponding octal digit.
To change permissions, you use the chmod command. (Permissions are sometimes called the
file’s mode, so chmod is short for change mode.) This command takes a mode, expressed either
in octal form or as a set of symbolic codes. The octal form is easier to understand, although
many newcomers find the octal representation confusing:
# chmod 660 /home/project7/xorg.conf
rwxr-x--- 750 Read and execute permission for the owner and group.
The file’s owner also has write permission. Users who
are not the file’s owner or members of the group have no
access to the file.
rwx------ 700 Read, write, and execute permissions for the file’s owner
only; all others have no access.
rw-rw-rw- 666 Read and write permissions for all users. No execute
permissions to anybody.
rw-rw-r-- 664 Read and write permissions to the owner and group.
Read-only permission to all others.
rw-rw---- 660 Read and write permissions to the owner and group. No
world permissions.
rw-r--r-- 644 Read and write permissions to the owner. Read-only
permission to all others.
rw-r----- 640 Read and write permissions to the owner, and read-only
permission to the group. No permission to others.
rw------- 600 Read and write permissions to the owner. No permis-
sion to anybody else.
r-------- 400 Read permission to the owner. No permission to any-
body else.
TABLE 1.1 Example Permissions and Their Likely Uses (continued)
Permission String Octal Code Meaning
83484.book Page 15 Monday, September 18, 2006 8:58 AM










