Introduction to Linux Flashcards

1
Q

Select the right alternative

What does the command pwd do?
1. Prints the current directory
2. Prints the current password
3. Let you update the current user’s password
4. changes directory to the current user’s home directory

A
  1. Prints the current work directory. As pwd stands for Print Working Directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which command would you use to list files in your home directory?
cd ~
ls~
cd /
ls /

A

ls ~, since ‘~’ means the current user’s home directory.

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

What does the file permission rwxr- -r- - kali kali mean?

A

It means that the file owner can read, write and execute the file. Members of the Kali group and all other users can only read the file.

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

Which command can we use to achieve the permissions of rwx- -x- -x?

A

chmod 711 filename
7 => 111 and will grant the file owner all the permissions.
1 => 001 and will only give the permission to execute for group members and all other users.

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

For what is the sudo command used for?

A

It’s used when an user wants to run commands as another user, usually one of a higher privillege or the root user.

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

How can you change to the root user?

A

sudo su -

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

What does the updatedb command do?

A

It updates the file database used by the locate command.

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

What is the passwd file?

A

It’s a plain text file that stores information about users.

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

What is the ‘:x:’ section in an entry of the passwd file?

A

It’s a placeholder that’ll be replaced by the contents of the shadow file.

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

What does the shadow file contain?

A

The shadow file contains all the password hashes of the system.

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

What is the sudoers file?

A

The sudoers file specifies the commands that an user can run and what level of privillege he has to run specific commands.

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