Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.

2022, 00:13

Midterm Exam
Due Oct 27 at 2:15pm Points 15 Questions 40
Available Oct 27 at 2:15pm - Nov 15 at 4:15pm Time Limit 90 Minutes

This quiz was locked Nov 15 at 4:15pm.

Attempt History
Attempt Time Score
LATEST Attempt 1 81 minutes 13.7 out of 15

Score for this quiz: 13.7 out of 15


Submitted Oct 27 at 3:36pm
This attempt took 81 minutes.

Question 1 0.1 / 0.1 pts

You can use the -a option with the ls command to list


____________________ files.

You Answered
hidden files (starting with . (dot)

Correct Answers hidden

Question 2 0.1 / 0.1 pts

A(n) ____________________ is a special character that can stand


for any other character or, in some cases, a group of characters.

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 1 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

You Answered
wildcard. * for group of characters, ? for one

Correct Answers wildcard

Question 3 0.1 / 0.1 pts

UNIX/Linux systems interpret ____ to mean the parent directory.

backward slash (\)

dot (.)

forward slash (/)

Correct! dot (..)

Question 4 0.1 / 0.1 pts

Compiled and interpreted files that can be run are called ____
program files.

binary

assembly

Correct! executable

dynamic

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 2 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Question 5 0.1 / 0.1 pts

How can you save a file without exiting vi?

Your Answer:

you can use :w in a command mode (after pressing esc)

Question 6 0.1 / 0.1 pts

A binary digit, called a(n) ____________________ for short, is in one


of two states.

You Answered
byt

Correct Answers bit

Question 7 0.1 / 0.1 pts

For some languages, such as Chinese, the ASCII character set is


preferred instead of the Unicode character set.

True

Correct!
False

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 3 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Question 8 0.1 / 0.1 pts

What is ASCII?

Your Answer:

it is character set which consists of 256 characters and used for


interpretation. bigger character set is unicode which consists of more
than 32.000 charcaters

Question 9 0.1 / 0.1 pts

The vi editor’s ____ mode is started by pressing Esc.

Correct! command

ex

edit

insert

Question 10 0.1 / 0.1 pts

The ____________________ option of the paste command causes


files to be pasted one after the other instead of in parallel.

You Answered
-s, serial

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 4 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Correct Answers -s

Question 11 0.1 / 0.1 pts

System administrators and programmers refer to standard output as


____.

sout

Correct! stdout

standardout

stout

Question 12 0.1 / 0.1 pts

UNIX/Linux store data, such as letters, product records, or vendor


reports, in flat ASCII files.

Correct! True

False

Question 13 0.1 / 0.1 pts

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 5 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

The ____ command is used to look for patterns in files.

pattern

Correct!
awk

search

find

Question 14 0.1 / 0.1 pts

When you use the paste command, by default, the pasted results
appear in columns separated by commas.

True

Correct! False

Question 15 0.1 / 0.1 pts

What is the find command used for?

Your Answer:

it is used for a search for file in a directory

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 6 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Question 16 0.3 / 0.3 pts

When you write a script, it is advisable to specify with what shell the
script is intended to be used. How can you do this?

Your Answer:

#/bin!/bash

Question 17 0.3 / 0.3 pts

The ____ option of the diff command is used to display the


differences side-by-side in columns.

-n

-c

-s

Correct! -y

Question 18 0 / 0.3 pts

You use the ____ command to search for a specified pattern in a file,
such as a particular word or phrase.

diff

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 7 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Correct Answer grep

You Answered sed

find

Question 19 0.3 / 0.3 pts

What is the diff command used for?

Your Answer:

it is used to compare file lines by lines

Question 20 0.3 / 0.3 pts

In some cases, when you use grep, it is helpful to enter the character
pattern you are trying to find in single or double quotes. Why?

Your Answer:

so it will be accurate and you wont mix it with something else

Question 21 0.3 / 0.3 pts

What is an algorithm?

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 8 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Your Answer:

it is the pre defined arithmetic structure to perform certain tasks

Question 22 0.3 / 0.3 pts

____ variables are used to store information about the setup of the
operating system, and after they are set up, you typically do not
change them.

Shell

Correct! Configuration

Global

Environment

Question 23 0 / 0.3 pts

Shell scripts run more quickly than compiled programs.

You Answered True

Correct Answer False

Question 24 0.3 / 0.3 pts

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 9 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

____ operators compare the relationship between two values or


arguments.

Evaluation

Comparison

Logical

Correct! Relational

Question 25 0.3 / 0.3 pts

What is looping logic?

Your Answer:

it is processes using either for or while to perform certain tasks

Question 26 0.3 / 0.3 pts

If a source file contains ____ errors, it cannot be converted into an


executable file.

logic

debugging

Correct! syntax

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 10 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

compilation

Question 27 0 / 0.3 pts

Logic structures supported by shell scripts include: sequential logic,


decision logic, looping logic, and ____________________ logic.

You Answered
sequiational

Correct Answers case

Question 28 0.3 / 0.3 pts

Logic structures are also called ____ structures.

sequential

Correct! control

decision

programming

Question 29 0.3 / 0.3 pts

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 11 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Shell scripts support many shell script ____________________,


including those for assigning the contents of a shell variable, for
evaluating information, for performing mathematical operations, and
for piping or redirection of input/output.

Correct!
operators

Correct Answers operators

Question 30 0.3 / 0.3 pts

The Bash shell offers improved features over the older Bourne and
Korn shells and is fully backward compatible with the Bourne shell.

Correct! True

False

Question 31 0.3 / 0.3 pts

You should omit spaces when you assign a variable without using
single or double quotation marks around its value.

Correct! True

False

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 12 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Question 32 0.2 / 0.2 pts

When you create a script, you should include the command that sets
the particular shell to use on ____.

Correct! the first line of the script

your login script

the configuration file

the last line of the script

Question 33 0 / 0.2 pts

The clear command is a useful housekeeping utility for clearing the


screen, but you can use a faster method. Describe this alternative
method.

Your Answer:

move down the screen

Ctrl+L

Question 34 0.2 / 0.2 pts

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 13 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

What is a Boolean operator?

Your Answer:

They are operators that are used for truth tables and in code. value
for it could be either true (1) or false (0)

Question 35 0.2 / 0.2 pts

How can you view the most recent command’s exit status?

Your Answer:

$! could be used

Question 36 0 / 0.2 pts

What is the test command used for?

Your Answer:

it is used to check file types and compare values in the files

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 14 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Question 37 0.2 / 0.2 pts

The .bashrc file is a hidden file contained in ____ directory.

the /usr

the /home

Correct! your home

the root

Unanswered Question 38 2.5 / 2.5 pts

Write a script that creates the following calculator:

Enter first value: value1


Enter second value: value2
value1 + value2 = ?
value1 - value2 = ?
value1 * value2 = ?
value1 / value2 = ?
average =

Upload all files as .zip file!

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 15 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Unanswered Question 39 2.5 / 2.5 pts

Write a script that creates the following menu:

Soup Menu
==========
(t)omato
(b)ean
(s)quash
(c)hicken
(l)amb
(m)ushrooms
=============
Select a soup . . . (q) to quit

With this script user should to place order in restaurant and generate
the list of order items saved in separate files, named
LastnameFirstname_Date_Time.order !

Upload all files as .zip file!

Unanswered Question 40 2.5 / 2.5 pts

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 16 of 17
Midterm Exam: COS231a_F2022 Introduction to UNIX 28.11.2022, 00:13

Troubleshoot the problems with the following script:

#========================================
=======
Script Name: record_entry
By: TRJackson
#========================================
=======
looptrack = y
while [ "$ looptrack ""==11]
do
echo -n “Type in the account number:” rea
d account
echo -n “Type the first and last name:” ;
read full_name
echo -n “Type the age:” red age
echo -n “Enter another record?” ; read lo
optrack
finish

Upload corerct file!

Quiz Score: 13.7 out of 15

https://aubg.instructure.com/courses/3570/quizzes/4628 Page 17 of 17

You might also like