Skip to Content
Ubuntu: Up and Running
book

Ubuntu: Up and Running

by Robin Nixon
April 2010
Beginner
464 pages
12h 7m
English
O'Reilly Media, Inc.
Content preview from Ubuntu: Up and Running

File and Folder Permissions

In Chapter 5, we looked at managing groups, users, and file permissions from the desktop. Here, you’ll learn how to do all that and more from the command line. Let’s recall the possible file attributes, which are:

  1. No permissions

  2. Execute only

  3. Write only

  4. Execute and Write

  5. Read only

  6. Execute and Read

  7. Write and Read

  8. Execute and Write and Read

I have numbered them from 0 to 7 because these values are used by the system to store the attributes in octal (base 8). Table 7-7 shows each of these attributes, with a checkmark indicating where an attribute is set.

Table 7-7. The eight possible file attribute values

Value

Read

Write

Execute

0

   

1

  

2

 

 

3

 

4

  

5

 

6

 

7

Looking at these checkmarks, you’ll see that they actually represent the binary values for 0 through 7, like this:

0 = 000
1 = 001
2 = 010
3 = 011
4 = 100
5 = 101
6 = 110
7 = 111

The highest value that can be created from three binary digits is 7, and so this is how the octal system of file permissions came about.

But in Ubuntu Linux (as with Unix and other Linux distributions), there are actually three sets of attributes (known as permissions) for each file and folder: one for the owner of the file or folder, one for the group that is allowed to access it, and one for everybody else.

The Owner, Group, and World Attributes

With eight possible permutations of permissions (and three sets of them), there are 512 different possible permissions per file. So, how on earth does anyone, or even the computer, keep track of all ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu Made Easy

Ubuntu Made Easy

Rickford Grant, Phil Bull
Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9781449382827Errata Page