Table of Contents
Hands-on Introduction to Linux Commands and Shell Scripting Week 01 Quiz Answer
Practice Quiz: Introduction to Linux
Q1. Which of the following statements about Linux is NOT true?
- The Android operating system used in many smartphones uses a Linux-based kernel.
- Windows is based on the Linux operating system.
- Clusters of Linux servers can be used for high-performance computing applications.
- Enterprise and cloud data centers can run on Linux servers.
Q2. Which of the following is a Linux distribution?
- IBM AIX
- Open Solaris
Q3. Which of the following is an example of a shell?
Q4. Which of the following is the best definition of a Linux terminal?
- An application you can use to interact with the Linux shell
- An application you can use to edit text files
- An application you can use to install Linux software
- An application you can use to update Linux software
Q5. Which of the following text editors can you use in both GUI and command-line mode?
- GNU nano
Graded Quiz: Introduction to Linux
Q1. Which of the following statements about Linux distributions is NOT true?
- Each Linux distribution is tailored for a specific audience or task.
- A Linux distribution is also known as a distro.
- A Linux distribution must be based on the Linux kernel.
- There are only three types of Linux distribution: core, desktop, and server.
Q2. Which layer of the Linux system contains system daemons and shells?
- Operating system
Q3.Which layer of the Linux system assigns software to users, helps detect errors, and performs file management tasks?
- Operating system
Q4.Which layer of the Linux system is responsible for memory management, process management, device driver management, and system calls and security?
- Operating system
Q5. Which of the following is NOT a directory in the Linux filesystem?
Q6. Which of the following is a GUI-based text editor?
Q7. Which of the following is a path that you can use to navigate to a user’s home directory?
Correct. The special path ~ refers to a user’s home directory.
Q8. Packages are:
- Text editors
- Archive files
Q9. Which command can you use to convert package files between deb and RPM formats?
Q10. An advantage of using a GUI-based package manager such as PackageKit is that:
- It automatically checks for updates at configurable intervals.
- It works on deb- and RPM-based Linux.
- It automatically installs new software packages.
- It always installs all available updates, so users cannot opt to only install specific updates.
Practice Quiz: Linux Commands
Q1. Which of the following is NOT one of the Linux shell definitions?
- Enable access to applications
- Interactive language Scripting language
- User interface for running commands
Q2. A Linux shell is an interface for running commands. It is also:
- A user-defined algorithm. An operating system.
- An interactive language.
- an error-logging script.
Q3.Which two of the following four commands could you use to list running processes and information
about each process?
The “ps” command is used to display the currently running processes, including the time each process has
been running and other information.
Q4.Which one of the following four commands can be used to list the number of lines in your file?
cat wchead more
Q5.Which one of the following four statements about Linux commands for customizing your view of a file’s
contents is false?
The “grep” command returns lines of a file matching a specified pattern, such as a regular expression.You can use the paste command to merge lines from multiple files. You can use the cut command to extract specific sections from each line in your file. You can use the paste command to dump your clipboard’s content to a file.
Q6.Which of the following common shell commands for navigating files or directories prints the current
pwd find cd ls
The touch command is used to ___________:
change the contents of an existing file or its access rights. create a file if it does not exist or otherwise delete it. create a file if it does not exist or otherwise update its “last-modified date” attribute.copy a file or modify its executable permission.
Q8. Which of the following statements are true?
The zip command can be used to parse a text file. The zip command can be used to archive files into a tarball. The tar command can be used to compress files.The zip command can be used to bundle files together into a single Linux kernel.
9. Similar to curl – the wget command is used to ___________.
wrangle a file to get user data and other useful information. retrieve the HTML code for a web page.write a file to a URL, including the HTML code to build a web page. upload GNU files to a web server for subsequent hash code analysis.
. wget can retrieve a file located at a URL or it can retrieve the HTML code for a web page and has
recursive file downloading capabilities.
10.Which two of the following four commands can you use to retrieve files or data from a URL?
Correct. The “curl” command is a powerful tool that allows the transfer of data to and from URLs. ifconfig wget
Graded Quiz: Linux Commands and Shell Scripting
Q1. Which of the following shells is usually the default on Linux systems?
- Bourne shell
- bourne again shell
Q2. Which of the following common shell commands for working with files creates an empty file and updates a file timestamp?
Q3. Which of the following common networking commands, displays or configures system network interfaces?
Q4. What is one of the advantages of shell scripts over compiled languages?
- interpreted at runtime
- listed line by line in text files
- easier and faster to develop
- interactively enter commands on command line
Q5. Shell scripts are scripts that invoke a shell program. Which of the following invokes the Bourne shell program?
Q6. The ‘Hello World’ shell script example uses an ‘output redirection’ operator with the bash shebang. Which of the following symbols is used as the redirection operator?
- ‘double greater than symbol’ >>
- ‘double less than symbol’ <<
- ‘double pipe symbol’ ||
- ‘double plus sign symbol’ ++
Q7. What purpose does chaining filters together produce?
- Multi-use script
Q8. What symbol do you use to define shell variables?
- greater than symbol >
- equal sign =
- plus sign +
- dollar sign $
Q9. Which command lists all environment variables?
Q10. Which of the following is the cron job syntax?
- time day date command
- command m h dom mon dow
- crontab -e
- m h dom mon dow command