Module 7 Live Virtual Machine Labs 1-8 Flashcards

1
Q

You need to make the shell script executable. Which of the parameter along with the chmod command should you use?

+x
-x
+rwx
-rwx

A

+x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

lab 7-1

The _______ statements are mainly used for making a decision and therefore, are known as decision-making statements.

until loop
for loop
while loop
if…else
case…esac

A

if…else

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In a scenario, where you have multiple conditions, it is best to use ________ statements.

if…else
for loop
until loop
while loop
case…esac

A

case esac

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which two loops run until a statement becomes true? [Choose two.]

for loop
while loop
case…esac
until loop
if…else

A

while loop
until loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The ______ loop runs through a list of values in a list until the time list values are exhausted.

for loop
if…else
until loop
while loop
case…esac

A

for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

lab 7-2

Which variables are contained in /etc/profile? [Choose all that apply.]

USER
PATH
MAIL
HOSTNAME
HISTSIZE

A

USER
PATH
MAIL
HOSTNAME
HISTSIZE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The ____ profile is the user configuration file in which the user environment can be configured.

~/.bash_profile
~/.bash_login
/etc/profile
/etc/bashrc

A

~/.bash_profile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If the ~/.bash_profile does not exist, then the __________ file is read.

~/.profile
/etc/bashrc
/etc/profile
~/.bash_login

A

~/.bash_login

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The _________ gets executed only during a login shell.

~/.bash_profile
~/.bash_login
/etc/profile
/etc/bashrc

A

~/.bash_profile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which value with the chmod command will make a shell script executable?

100
400
700
444

A

700

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

lab 7-3

The default output of a command is displayed on the _______. [Choose all that apply.]

File
Keyboard
Screen
Console

A

console
screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The output of a command is redirected to a new file with the help of the _____ operator.

> > <
«

A

>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which operator will overwrite the contents of an existing file?

> &laquo_space;
>
<

A

>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which operator will append the output to the same file without overwriting it?

> > <
«

A

> >

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

lab 7-4

To send the content of one file to another file, you can use the _______ redirector.

&laquo_space;
>
»
<

A

>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The ________ command is another filter that is used to print the selected output of a file onto the screen.

cp
ls -l
ls
cut

17
Q

lab 7-5

Which of the following standard input value is used for the default keyboard?

1
3
2
0
4

17
Q

The _______ command is another filter that converts tabs to spaces, without affection the source file. By default, a tab consists of eight spaces.

expand
ls -l
cp
cut
ls

18
Q

You can use ________ to convert the spaces back to default tabs in a file.

unexpand
cp
cut
expand
ls -l

19
Q

The _______ command is used to define the uniform spacing between words and sentences.

expand
cp
cut
fmt
unexpand
ls -l

20
Q

Which two standard output values are used for the default terminal? [Choose two.]

3
4
0
1
2

21
Q

To append the information to an existing file, which type of redirector should be used>

> > «<

22
Q

Which of the following is used for combining two outputs?

|
#
&
>

23
Q

Which operator is typically used with the xargs command?

&
>
#
|

24
lab 7-6 Which command prints partial or full environment variables? env print printenv set
printenv
25
Which command prints the name and value of each shell variable available? printenv print set env
set
26
Which command prints the all exported environment variables? print printenv set env
env
27
lab 7-7 Which of the following is the global profile used for all the users in a Linux system? /etc/profile /etc/bash /etc/users /etc/hosts
/etc/profile
28
Which of the following is activated when the user logs on and also loads the environment variables? /var/passwd ~/bashrc /etc/hosts .profile
.profile
29
Which of the following file is executed when a login shell exits? .profile .bash_logout /etc/hosts ~/bashrc
.bash_logout
30
Which command will list the environment variables? top env nice renice ps
env
31
Which command enables you to export variables to be used by other processes? export env renice nice top ps
export
32
lab 7-8 What is the extension of a shell script? .exe .txt .ps .sh
.sh
33
Which are two methods to execute a shell script named plab.sh? [Choose two.] ./plab.sh bash plab.sh .plab.sh plab.sh
bash plab.sh ./plab.sh
34
Which command should you enter to save and exit a file that is opened in the vi editor? :wq :sq :ws :aq
:wq
35
Which of the following executes a list of commands repeatedly till the specified condition is reached? while do for if
while
36
You can use the ______ loop to check for a condition and perform a task. for while do if
if