Files Flashcards

1
Q

In long listing file details displayed, what are values for the first position?

A
  • normal file
    d directory
    l is a symbolic link.
    c is a character device file.
    b is a block device file.
    p is a named pipe file.
    s is a local socket file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

change group ownership of a file file.txt to admins

A

chown : admins file.txt

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

show details of a directory

A

ls -ld directory

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

List of special permissions

A

1) Sticky
2) suid
3) guid

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

Explain sticky permission

A

Users can remove only files they own

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

How do you set sticky special permission

A

chmod +t folder

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

Explain suid special permission

A

File executes with owner’s permission instead of runner’s

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

Set suid special permission on file.sh

A

chmod u+s file.sh

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

Explain guid special permission

A

1) File executes as the group that owns the file.
2) New files inherit the group owner of the directory.

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

Set guid special permission on file.sh

A

chmod g+s file.sh

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

Explain the permissions: -rwsr-xr-x

A

User has suid special permission on the file. That means when someone executes the file, it runs with the owner permission instead of the runner permission

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

Add the setgid bit on the example directory by using the symbolic method

A

chmod g+s example

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

Remove the setuid bit on the example directory by using the symbolic method

A

chmod u-s example

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

Set setgid bit and add read, write, and execute permissions for user and group, with no access for others, on the example directory using the octal method

A

chmod 2770 example

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

displays the current value of the shell’s umask

A

umask

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