|
|
When you specify permissions using absolute mode, you use a three-digit octal number to specify the permissions for owner, group, and other.
For example,
if you wanted to change the permissions on a file so that
the owner had read and write permission, members of the group had
read permission, and no one else had any permissions, you could type:
chmod 640 file
Here file is the name of the file.
In the preceding example, 640 is an octal number representing file permissions. The 6 represents the permissions for owner, the 4 is the permissions for group, and the 0 is the permissions for other. These digits are arrived at by taking the binary value of each permission, read, write, or execute, and adding them together to form one octal digit that represents the whole set (owner, group, or other).
Here are the octal values for some common permission settings:
Permission | Value |
---|---|
r | 4 |
w | 2 |
x | 1 |
r+w | 6 |
r+x | 5 |
all permissions | 7 |
r--------
, you could type:
To change a file's permissions to rwxrwxr-x
, you could type:
chmod 775 file
As you can see, once you are used to changing permissions using
absolute mode, it can be a quicker method than symbolic mode.