chmod Revisited: Octal Notation Flashcards

1
Q

The chmod command can use an…?

A

alternate octal syntax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The octal syntax is often…?

A

quicker and more exacting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

[student@station student]$ chmod og-r diary

This syntax has some advantages, but also some disadvantages. Because the…?

A

syntax is very readable, the intent of the command is fairly evident: the student does not want other users reading the diary. What are the resulting permissions on the file diary? A drawback of the syntax is that, knowing that this command was run, you cannot say! Is the file writable to group members? others? Without knowing the original permissions, you do not known.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

chmod 600 diary….?

A

gives the permissions rw——-. As an added benefit, once learned, the octal system tends to be quicker to use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where did the 600 come from…?

A

Recall that a file has 3 different types of permissions ((r)ead, (w)rite, and e(x)ecute) for three classes of user acces ((u)ser owner, (g)roup owner, and (o)ther). With the octal notation, each access gets a digit: the “hundreds” place for (u(ser, the “tens” palce for (g)roup, and the “ones place for (o)ther. Each permission type gets a vale: (r)ead gets 5, (w)rite gets 2, and e(x)ecute gets 1. The digits in the octal notation are just the sum of the allowed permissions for that class of access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

755 = ???

A

rwxr-xr-x

7 = 4 + 2 + 1 = rwx for (u)ser
5 = 4 + 0 + 1 = r-x for (g)roup
5 = 4 + 0 + 1 = r-x for (o)ther
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

640 = ???

A

rw-r—–

6 = 4 + 2 + 0 = rw- for (u)ser
4 = 4 + 0 + 0 = r-- for (g)roup
0 = 0 + 0 + 0 = --- for (o)ther
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

701 = ???

A

rwx—–x

7 = 4 + 2 + 1 = rwx for (u)ser
0 = 0 + 0 + 0 = --- for (g)roup
1 = 0 + 0 + 1 = --x for (o)ther
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The notation is called an….?

A

“octal” notation, because each digit has 8 possible values (0 through 7).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Once learned, the octal notation provides a quick way to refer to…?

A

the permissions on a file. For example, experienced Unix administrators will often refer to a file having “644” permissions, or a directory having permissions of “755”. In Unix, the state of a file’s permissions is often referred to as the mode of the file. In particular, this term is used to refer to a file’s permissions in octal notation. For example, a system administrator might say “Directories are created with a default mode of 775”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

chgrp -R tells chgrp to …?

A

recourse through a directory (and all it’s subdirectories. chmod, chgrp, and chown all have this command line switch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Directories and regular files have different “reasonable” permissions. Namely, directories should have…?

A

the e(x)ecute permission set, while regular files generally should not. Unfortunately, chmod -R does not distinguish between the file and directories.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly