Hands-on Introduction to Linux Commands and Shell Scripting Quiz Answer

Coursera was launched in 2012 by Daphne Koller and Andrew Ng with the goal of giving life-changing learning experiences to students all around the world. In the modern day, Coursera is a worldwide online learning platform that provides anybody, anywhere with access to online courses and degrees from top institutions and corporations.

Join Now

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
  • Debian
  • FreeBSD
  • Open Solaris

Q3. Which of the following is an example of a shell?;

  • Vim
  • Yum
  • Arch
  • Zsh

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?

  • emacs
  • gedit
  • GNU nano
  • vim;

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?

  • Application
  • Kernel
  • Operating system
  • Hardware

Q3. Which layer of the Linux system assigns software to users, helps detect errors, and performs file management tasks?

  • Kernel
  • Operating system
  • Hardware
  • Application

Q4.Which layer of the Linux system is responsible for memory management, process management, device driver management, and system calls and security?

  • Hardware
  • Operating system
  • Application
  • Kernel

Q5. Which of the following is NOT a directory in the Linux filesystem?

  • load
  • home
  • boot
  • bin

Q6. Which of the following is a GUI-based text editor?

  • gedit
  • GNU
  • nano
  • vim
  • vi

Q7. Which of the following is a path that you can use to navigate to a user’s home directory?

  • ~
  • \home
  • \myhome
  • \

Correct. The special path ~ refers to a user’s home directory.

Q8. Packages are:

  • Kernels
  • Backups
  • Text editors
  • Archive files

Q9. Which command can you use to convert package files between deb and RPM formats?

  • alien
  • update
  • yum
  • apt

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

1.Question 1

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?

1 / 1 point man top;

The “ps” command is used to display the currently running processes, including the time each process has

been running and other information.​

4.Question 4

Which one of the following four commands can be used to list the number of lines in your file?

1 / 1 point cat wchead more

Correct

Correct. You can use the wc command to count the number of characters, words, or lines in your file.

5.Question 5

Which one of the following four statements about Linux commands for customizing your view of a file’s

contents is false?

1 / 1 point 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.;

Correct

Correct. This is a false statement.

6.Question 6

Which of the following common shell commands for navigating files or directories prints the current

working directory?

1 / 1 point pwd find cd ls

Correct

Correct. This command prints the current or present working directory.

7.Question 7

The touch command is used to ___________:

1 / 1 point 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.

Correct

Correct. The “touch” command can be used to create empty files or update an existing file’s last-modified

date.​

8.Question 8

Which of the following statements are true?

1 / 1 point 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.

Correct

Correct. It is possible to archive and compress a file into a tar.gz file. This is done by adding the –z option in

the tar command.

9.Question 9

Similar to curl – the wget command is used to ___________.

1 / 1 point 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.

Correct;

Correct. 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.Question 10

Which two of the following four commands can you use to retrieve files or data from a URL?

1 / 1 point ping curl

Correct

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
  • Ksh;
  • bourne again shell
  • zsh

Q2. Which of the following common shell commands for working with files creates an empty file and updates a file timestamp?

  • grep
  • chmod
  • wc
  • touch

Q3. Which of the following common networking commands, displays or configures system network interfaces?

  • curl
  • ping
  • ifconfig
  • wget

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?

  • #!/bin/bash
  • #!/bin/zsh
  • #!/bin/sh
  • #!/bin/ksh

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?

  • Pipeline
  • Multi-use script
  • Modifier;
  • Examiner

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?

  • env
  • grep
  • export
  • gree

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

Review:

Based on our knowledge, we urge you to enroll in this course so you can pick up new skills from specialists. It will be worthwhile, we trust.

 

Leave a Comment