The permissions of a file, as you've seen throughout this chapter, come in sets of threerwx, for read, write, and execute permissions. And, as we showed you, you set these permissions by specifying that each one is either "on" or "off." For example, ugo+rwx sets read, write, and execute permissions to "on" for user, group, and other, while a+rw sets read and write to "on" for everyone, and a-x sets execute to "off" (indicated in directory listings with the -). Rather than set permissions with letters and hyphens, however, you can translate them into numeric values, using 1 for "on" and 0 for "off." So, rw-, with read and write "on" and execute off, would translate into the numbers 110. You could think of this as counting in binary000, 001, 010, 011, 100, 101, 110, 111, with a 1 in each place that the permission is set to "on." Each of these combinations of on/off permissions (or binary numbers) can be expressed as a unique decimal digit between 0 and 7, as shown in Table 5.1. It is these decimal digits that you use to set permissions.
To set permissions using numeric equivalents:
|