tools of the trade linux and sql coursera weekly challenge 3 answers
Test your knowledge: Navigate the Linux file system in Bash
1. What is a command?
- A common shell in many Linux distributions
- An instruction that tells a computer to do something
- The highest-level directory in Linux
- A component of the Linux architecture
2. Which of the following commands prints the working directory to the screen?
- cat
- ls
- pwd
- head
3. What does the cd command do?
- Navigates between directories
- Outputs a specified string of text
- Displays the names of files in the current directory
- Prints the working directory to the screen
4. A security professional enters head access.txt into a shell. What are they telling the operating system to do?
- Remove the first 5 lines of access.txt
- Return the content of access.txt one page a time
- Display the first 10 lines of access.txt
- Add a header to the file named access.txt
5. What is the difference between an absolute file path and a relative file path?
- An absolute file path starts from the current directory, and a relative file path starts from the root.
- An absolute file path ends with a forward slash (/), and a relative file path ends with a backslash (\).
- An absolute file path starts from the root, and a relative file path starts from the current directory.
- An absolute file path ends with a backslash (\), and a relative file path ends with a forward slash (/).
Test your knowledge: Manage file content in Bash
6. What two arguments commonly follow the grep command?
- The file to move and the new file location
- The string to search for and the file to search through
- The file to write to and the string to add to it
- The file name to search for and the directory to search through
7. In Linux, what does the piping command (|) do?
- It searches a specified file and returns all lines in the file containing a specified string.
- It moves a file or directory to a new location.
- It sends the standard input of one command as standard output to another command for further processing.
- It sends the standard output of one command as standard input to another command for further processing.
8. A security professional enters cp vulnerabilities.txt /home/analyst/projects into the command line. What do they want the operating system to do?
- Create a new file named vulnerabilities.txt in the projects directory
- Remove the vulnerabilities.txt file from the projects directory
- Search for the string vulnerabilities.txt in the projects directory
- Copy the vulnerabilities.txt file into the projects directory
9. What command creates a new file called failed_logins.txt?
- find failed_logins.txt
- mkdir failed_logins.txt
- touch failed_logins.txt
- rm failed_logins.txt
Test your knowledge: Authenticate and authorize users
10. What is authorization?
- The concept of granting only the minimal access and authorization required to complete a task or function
- The concept of granting access to specific resources in a system
- The process of a user proving that they are who they say they are in the system
- The process of temporarily granting elevated permissions to specific users
11. Which of the following statements correctly describe the file permissions string -rw-rw-rw-? Select two answers.
- The user and group have execute permissions.
- The user has write permissions.
- The file type is a directory.
- The group has read permissions.
12. A security professional enters chmod g+w access.txt into the command line. What does this command tell the operating system to do?
- Add write permissions to the user for the access.txt file
- Remove write permissions from the group for the access.txt file
- Add write permissions to the group for the access.txt file
- Remove write permissions from the user for the access.txt file
13. Which of the following commands typically must be used with sudo? Select three answers.
- useradd
- chmod
- userdel
- chown
14. A security analyst is updating permissions on a directory named projects. The current permissions are drwxrw-r--. They want to add execute permissions for the group. What do they enter on the command line?
- chmod g+x projects
- chmod u-x projects
- chmod x+x projects
- chmod g-x projects
Test your knowledge: Get help in Linux
15. Which of the following statements accurately describe Linux’s online global community? Select three answers.
- Because Linux is open-source, the community can easily contribute.
- The community is focused on collecting feedback from advanced users of Linux.
- Linux users can find support from the community for everyday tasks.
- The community publishes online information to help users learn how to operate Linux.
16. What does the man command do?
- Display a description of a command on a single line
- Display information on other commands and how they work
- Search the manual page descriptions for a specified string
- Delete a user from the system
17. What does the whatis command do?
- Return the username of the current user
- Display information on other commands and how they work
- Search the manual page descriptions for a specified string
- Display a description of a command on a single line
18. What is an advantage of the apropos command?
- It incorporates mandatory options for customized searching
- It condenses the description of a specific command to one line.
- Users can search for a command even if they do not know the specific command name.
- It can be used to search for descriptions of commands when you know the specific command name.
Weekly challenge 3
19. What are the arguments in mv Q1users.txt /home/analyst/reports? Select two answers.
- Q1users.txt
- .txt
- mv
- /home/analyst/reports
20. Fill in the blank: The highest-level directory in Linux is called the _____.
- permissions
- root directory
- home directory
- sudo
21. What does the grep command do?
- Searches a specified file and returns all lines in the file containing a specified string
- Temporarily grants elevated permissions to specific users
- Prints the working directory to the screen
- Creates a new directory
22. What does the touch command do?
- Creates a new file
- Opens a file editor
- Moves a file or directory to a new location
- Changes permissions on files and directories
23. What are read, write, and execute?
- The three types of permissions for authorized users
- The three types of owners for files and directories
- Different methods for editing files
- Specific Linux commands used to change file permissions
24. A security analyst is updating permissions on the file access.txt. They want to add write permissions for the user and remove read permissions for the group. What do they enter on the command line?
- chmod u-w,g+r access.txt
- chmod u+rw,g-rw access.txt
- chmod access.txt u+w,g-r
- chmod u+w,g-r access.txt
25. A user is not a root user, but needs elevated privileges to use certain commands. What should they do?
- Use the sudo command
- Assign themselves write permissions
- Assign themselves execute permissions
- Use the chmod command
26. Which command can you use to change your current directory?
- pwd
- cat
- ls
- cd
27. What does the apropos command do?
- Searches the manual page descriptions for a specified string
- Displays detailed information on commands and their options
- Prints the working directory to the screen
- Displays a description of a command on a single line
28. Given the following permissions drw-rw-r--, what permissions does the group have? Select all that apply.
- Read
- Use
- Write
- Execute
29. A security analyst enters grep OS updates.txt into the command line. What does this tell the operating system to do?
- Create a new directory named OS and a new file named updates.txt
- Create a new file named updates.txt in the OS directory
- Search through the updates.txt file and return all lines containing the string OS
- Move the updates.txt file to the OS directory
30. What does sudo do?
- Temporarily grants elevated permissions to specific users
- Deletes users from the system
- Changes the owner associated with a particular file
- Adds users to the system
31. In which of these situations would you enter cd logs?
- You want to search for the string logs in the files of your current directory.
- You want to list all the files and directories in the logs directory.
- You want to change to a subdirectory of your current directory named logs.
- You want to print the first 10 lines of the logs file.
32. Given the following permissions drw-rw-r--, what does the fourth character represent?
- The group does not have execute permissions for this directory
- The user does not have execute permissions for this directory
- The user has execute permissions for this directory
- The group has execute permissions for this directory
33. What are the arguments in cp vulnerabilities.txt /home/analyst/projects? Select two answers.
- /home/analyst/projects
- vulnerabilities.txt
- cp
- /home
34. Which of the following items represents the root directory?
- /
- *home
- /home
- *
35. A security analyst enters touch updates.txt into the command line. What does this tell the operating system to do?
- Move the updates.txt file out of their current directory
- Create a new file named updates.txt in their current directory
- Open the updates.txt file
- Create a new file named updates.txt and move it to the root directory
36. Which of the following are types of permissions? Select all that apply.
- Read
- Write
- Authorize
- Execute
37. A security analyst enters chmod u+w,g-r access.txt into the command line. What does this command tell the operating system to do? Select all that apply.
- Remove read permissions from the user for the access.txt file
- Add write permissions to the user for the access.txt file
- Add write permissions to the group for the access.txt file
- Remove read permissions from the group for the access.txt file
38. Which of the following commands require the user to be a root user or have sudo privileges? Select two answers.
- cd
- useradd
- userdel
- grep
39. What should you specify in the argument following the cd command?
- Your current directory
- The string you want to search for
- The directory you want to navigate to
- The file you want to create
40. Which of the following commands searches the manual page descriptions for a specified string?
- cp
- pwd
- man
- apropos