Linux - Chapter 7 Review

¡Supera tus tareas y exámenes ahora con Quizwiz!

Every "if" construct begins with if and must be terminated with ___________.

fi.

How do you indicate a comment line in a shell script?

Begin the line with #.

Before a user-defined variable can be used by processes that run in subshells, that variable must be _____________.

Exported.

What is wrong with the following command string ls /etc/hosts >listofhostfile?

Nothing is wrong.

Which command could you use to set a list of all environment and user-defined variables as well as their current values?

Set.

What would be the effect of using the "alias" command to make an alias for the "date" command named "cat" in honor of your favorite pet?

When you use the cat command at the command prompt with the intention of viewing a text file, the date appears instead.

The current value for the HOME variable is displayed by which of the following commands?

echo ~ echo $HOME

Which of the following operators reverses the meaning of a test statement?

!

Which of the following commands is always executed immediately after any user logs in to a Linux system and receives a BASH shell?

/etc/profile

Which of the following file descriptor numbers represents stdout?

1

What does >> accomplish when entered on the command line after a command?

It appends Standard Output to a file.

A variable identifier must ____________.

Not begin with a number.

Which construct can be used in a shell script to read Standard Input and place it in a variable?

Read.

Which of the following is not necessarily generated by every command on the system?

Standard Input Standard Deviation

Consider the following shell script: echo -e "What is your favorite color?--> \c" read REPLY if [ "$REPLY" = "red" -o "$REPLY" = "blue" ] then echo "The answer is red or blue." else echo "The answer is not red nor blue." fi What would be displayed if a user executes this program and answered Blue when prompted?

The answer is not red nor blue.

The "alias" command can be used to make a shortcut to a single command. True or False?

True.

The "sed" and "awk" commands are filter commands commonly used to format data within a pipe? True or False?

True.

Because Standard Error and Standard Output represent the results of a command and Standard Input represents the input required for a command, only Standard Error and Standard Output can be redirected to/from a file. True or False?

False.

You have redirected Standard Error to a file called Errors. You view the contents of this file afterward and notice that there are six error messages. After repeating the procedure, you notice that there are only two error messages in this file. Why?

You did not append the Standard Error to the Error file and as a result, it was overwritten when the command was run a second time.

Which of the following will display the message welcome home if the cd /home/user1 command is successfully executed?

cd /home/user1 && echo "welcome home"

A "for" construct is a loop construct that processes a specified list of objects. As a result, it is executed as long as there are remaining objects to process. True or False?

True.


Conjuntos de estudio relacionados

GS MKT 306 CH 2 - Strategic Planning

View Set

Moore's Naturalism and the challenges to it

View Set

International Business-Chapter 5-Political Forces That Affect Global Trade

View Set

Pharm Final NCLEX Questions (based on medlist)

View Set

Chapter 9 Current Liabilities and Contingent Obligations

View Set

19 - Electric and Electronic Components

View Set

Positive Psychology Quiz #1 - Week 2 Slides

View Set