Linux Octal and Symbolic Permissions
Full-Access Members Only
Sorry, this lesson is only available to Server Academy Full-Access members. Become a Full-Access member now and get instant access to this and many more premium courses. Click the button below and get instant access now.
There are no resources for this lesson.
In the Linux and Unix operating systems, file permissions are a crucial aspect of security and access control. They determine who can read, write, and execute files and directories.
Try using the calculator below grant permissions to different groups, and see the resulting octal and symbolic codes that are generated:
You may notice the 644 number in the example above. The octal representation consists of three digits, each representing the permission for the owner, group, and others, respectively:
- Read (4): The ability to view the content of a file or list the contents of a directory.
- Write (2): The ability to modify or create new content within a file or directory.
- Execute (1): The ability to run or execute a file or access the contents of a directory.
So, the number used in the example above can be broken down as follows:
- Owner: 4 (read) + 2 (write) = 6
- Group: 4 (read)
- Others: 4 (read)
In symbolic representation, permissions are denoted by a set of three characters for the owner, group, and others, respectively. Each character slot can either have a character representing a permission or a
- indicating the absence of that permission. The characters used are
r for read,
w for write, and
x for execute. Here's a breakdown:
r(read): The ability to view the content of a file or list the contents of a directory.
w(write): The ability to modify or create new content within a file or directory.
x(execute): The ability to run or execute a file or access the contents of a directory.
The order of these characters is always the same:
r, followed by
w, followed by
Consider a file with permissions for the owner to read, write, and execute, for the group to read and execute, and for others to read only. The symbolic representation would be
rwxr-xr--. Here's the breakdown:
rwx(read, write, execute)
Converting Between Octal and Symbolic Representations:
It's important to be able to convert between octal and symbolic representations of permissions. Here's how you do it:
- For each set of permissions (owner, group, others), write down the symbolic representation (e.g.,
- Convert each symbolic representation to a sum of values based on the permission (e.g.,
rwx= 4+2+1 = 7,
r-x= 4+1 = 5,
- Combine these individual values to get the octal representation (e.g., 755).
So, the octal
755 corresponds to the symbolic
Server Academy Members Only
Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.