Introduction to Linux Flashcards
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
- Prints the current work directory. As pwd stands for Print Working Directory
Which command would you use to list files in your home directory?
cd ~
ls~
cd /
ls /
ls ~, since ‘~’ means the current user’s home directory.
What does the file permission rwxr- -r- - kali kali
mean?
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.
Which command can we use to achieve the permissions of rwx- -x- -x
?
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.
For what is the sudo command used for?
It’s used when an user wants to run commands as another user, usually one of a higher privillege or the root user.
How can you change to the root user?
sudo su -
What does the updatedb command do?
It updates the file database used by the locate command.
What is the passwd file?
It’s a plain text file that stores information about users.
What is the ‘:x:’ section in an entry of the passwd file?
It’s a placeholder that’ll be replaced by the contents of the shadow file.
What does the shadow file contain?
The shadow file contains all the password hashes of the system.
What is the sudoers file?
The sudoers file specifies the commands that an user can run and what level of privillege he has to run specific commands.