ZSH Permissions Flashcards

1
Q

Define the permissions set for this file [dr—w—x] [user] [group]

A
# +-------- Directory or not (D = directory - = not a directory)
# |  +------- User Read, Write, Execute
# |  |   +------- Group Read, Write, Execute
# |  |   |   +----- Other Read, Write, Execute
# |  |   |   |   +--- The name of the user
# |  |   |   |   |     +--- The name of the group
# |  |   |   |   |     |
# d | rwx | rwx | rwx user group
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the command below do?

$ chmod g+w sample.txt

A

Adds “write access” for group in sample.txt

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

What does the following command do?

$ chmod 777 test.sh

A

Adds read, write, and execute permissions to user, group, and other.

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

What does the following command do?

$ chmod 000 test.sh

A

0 No permission granted.

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

What does the following command do?

$ chmod 111 test.sh

A

1 Can execute.

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

What does the following command do?

$ chmod 222 test.sh

A

2 Can write.

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

What does the following command do?

$ chmod 333 test.sh

A

3 Can write and execute (2 + 1 = 3).

Combination of 2=’can write’ + 1=’can execute’

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

What does the following command do?

$ chmod 444 test.sh

A

4 Can read.

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

What does the following command do?

$ chmod 555 test.sh

A

5 Can read and execute (4 +1 = 5).

combination of 4=’can read’ + 1=’can execute’

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

What does the following command do?

$ chmod 666 test.sh

A

6 Can read and write (4 + 2 = 6).

combination of 4=’can read’ + 2=’can write’

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

What does the following command do?

$ chmod 777 test.sh

A

7 Can read and write and execute (4 + 2 + 1 = 7).

combination of 4=’can read’ + 2=’can write’ + 1=’can execute’

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

What does the following command do?

$ chmod 257 test.sh

A

The user has access to write. (2 = write)
The group had access to read and execute. (4=read + 1=execute)
The other has access to read, write and execute. (4=read + 2=write + 1=execute)

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

What does the following command do?

$ chmod 714 test.sh

A

The user has access to read, write, and execute. (1 = execute + 2 = write + 4 = read)
The group had access to execute. (1=execute)
The other has access to read (4=read)

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

What does the sudo command do?

A

Gain temporary access as a ‘root user’ godlike capabilities from the computer.

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