ZSH Permissions Flashcards
Define the permissions set for this file [dr—w—x] [user] [group]
# +-------- 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
What does the command below do?
$ chmod g+w sample.txt
Adds “write access” for group in sample.txt
What does the following command do?
$ chmod 777 test.sh
Adds read, write, and execute permissions to user, group, and other.
What does the following command do?
$ chmod 000 test.sh
0 No permission granted.
What does the following command do?
$ chmod 111 test.sh
1 Can execute.
What does the following command do?
$ chmod 222 test.sh
2 Can write.
What does the following command do?
$ chmod 333 test.sh
3 Can write and execute (2 + 1 = 3).
Combination of 2=’can write’ + 1=’can execute’
What does the following command do?
$ chmod 444 test.sh
4 Can read.
What does the following command do?
$ chmod 555 test.sh
5 Can read and execute (4 +1 = 5).
combination of 4=’can read’ + 1=’can execute’
What does the following command do?
$ chmod 666 test.sh
6 Can read and write (4 + 2 = 6).
combination of 4=’can read’ + 2=’can write’
What does the following command do?
$ chmod 777 test.sh
7 Can read and write and execute (4 + 2 + 1 = 7).
combination of 4=’can read’ + 2=’can write’ + 1=’can execute’
What does the following command do?
$ chmod 257 test.sh
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)
What does the following command do?
$ chmod 714 test.sh
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)
What does the sudo command do?
Gain temporary access as a ‘root user’ godlike capabilities from the computer.