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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

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
CentOS Quick Start Guide

CentOS Quick Start Guide

Shiwang Kalkhanda

Publisher Resources

ISBN: 9781449382827Errata Page