Comptia Linux +, Ch. 7

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

​echo $HOME, echo ˜

The current value for the HOME variable is displayed by which of the following commands? (Choose all that apply.)

set

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

read

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

1

Which of the following file descriptor numbers represents stdout?

/etc/profile

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

​It appends Standard Ouput to a file

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

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

​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?

True

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

Standard Deviation, Standard Input

​Which of the following is not necessarily generated by every command on the system? (Choose all that apply.)

!

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

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

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

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

​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?

True

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

Nothing is wrong with the command

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

fi

​Every if construct begins with if and must be terminated with?

Begin the line with #

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

True

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?

False

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

exported

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

The answer is not red nor blue

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?


Conjuntos de estudio relacionados

CS317, Finite Automata & Regular Expressions, Chapter 2: Finite Automata, Finite Automata

View Set

Human resource management Business chapter 9

View Set

Chapter 25 : Management of complications of Heart disease

View Set

CMPS 161 Chapter 7 Single-Dimmensional Arrays: Chapter Summary

View Set

Praxis Core 5722 - Writing Concepts

View Set