Deck 8: Working With the Bash Shell
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Match between columns
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/32
Play
Full screen (f)
Deck 8: Working With the Bash Shell
1
Any command that can be executed on the command line can also be placed inside any environment file.
True
2
The ____ command can be used to replace characters in a file sent via Standard Input.
A)tr
B)rt
C)ts
D)st
A)tr
B)rt
C)ts
D)st
A
3
You can redirect a file to the Standard Input of a command using the ____ metacharacter.
A)>
B)#
C)|
D)<
A)>
B)#
C)|
D)<
D
4
To prevent a file from being cleared by the BASH shell and append output to the existing output, you can specify three > metacharacters alongside the file descriptor.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
5
You are limited to using one pipe | metacharacter on the command line to pipe information from one command to another command.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
6
You can use the sed command to remove unwanted lines of text.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
7
To see a list of the environment variables and their current values on a system, you can use the ____ command.
A)env
B)get
C)set
D)setenv
A)env
B)get
C)set
D)setenv
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
8
You can send the Standard Output of one command to another command as Standard Input using the ____ shell metacharacter.
A)<
B)|
C)>
D)#
A)<
B)|
C)>
D)#
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
9
The ____ environment file is always executed immediately after login for all users on the system, and sets most environment variables, such as HOME and PATH.
A)~/.bash_profile
B)~/.bash_login
C)/etc/profile
D)~/.profile
A)~/.bash_profile
B)~/.bash_login
C)/etc/profile
D)~/.profile
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
10
The ____ command counts the number of lines, words, and characters in a file.
A)pr
B)nl
C)tr
D)wc
A)pr
B)nl
C)tr
D)wc
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
11
stderr is represented by the number ____.
A)0
B)1
C)2
D)3
A)0
B)1
C)2
D)3
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
12
The ____ command can be used to extract, manipulate, and format text using pattern-action statements.
A)sed
B)grep
C)awk
D)nl
A)sed
B)grep
C)awk
D)nl
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
13
You can use the BASH shell to redirect Standard Output and Standard Error from the terminal screen to a file on the filesystem using the ____ shell metacharacter followed by the absolute or relative pathname of the file.
A)#
B)<
C)>
D)|
A)#
B)<
C)>
D)|
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
14
Given the syntax command && command , the command on the left of the && construct is executed only if the command on the right of the && construct completed successfully.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
15
Most configuration files on Linux systems are delimited using ____ characters.
A)tab
B)colon
C)space
D)semicolon
A)tab
B)colon
C)space
D)semicolon
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
16
To see a list of all exported environment and user-defined variables in the shell, you can use the ____ command.
A)env
B)set
C)setenv
D)getenv
A)env
B)set
C)setenv
D)getenv
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
17
If you have ____ permission to a shell script, you can execute the shell script like any other executable program on the system.
A)read
B)write and read
C)execute
D)read and execute
A)read
B)write and read
C)execute
D)read and execute
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ escape sequence represents a form feed.
A)\n
B)\f
C)/f
D)/n
A)\n
B)\f
C)/f
D)/n
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
19
stdin is represented by the number ____.
A)0
B)1
C)2
D)3
A)0
B)1
C)2
D)3
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
20
The ____ command could be used to view the contents of the environment variable that represents the BASH shell prompt.
A)ls $PWD
B)echo #PWD
C)echo $PS1
D)ls #PS1
A)ls $PWD
B)echo #PWD
C)echo $PS1
D)ls #PS1
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
21
What are file descriptors? What are the three file descriptors are available to each command that can be manipulated by the BASH shell, and what is the purpose of each?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
22
What are shell variables? What are environment and user-defined variables?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
23
Match between columns
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
24
Describe the && and || constructs. How and why are they used?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
25
Any command that can take from Standard Input and give to Standard Output is called a(n)____________________ command.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
26
Most commands that are run by the shell are run in a separate ____________________, which is created by the current shell.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
27
What is a decision construct? What is the most common type of decision construct, and what is the syntax for using it?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
28
The test statement ____ would be used to determine if A is numerically greater than B.
A)[ A -g B ]
B)[ A -ge B ]
C)[ A -gt B ]
D)[ A +eq B ]
A)[ A -g B ]
B)[ A -ge B ]
C)[ A -gt B ]
D)[ A +eq B ]
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
29
The ____________________ environment variable contains a list of directories to search for executable programs.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
30
A case construct must be ended by ____________________.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
31
What are shell scripts? Why and how are they executed?
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck
32
The ____________________ command takes user input from Standard Input and places it in a variable specified by an argument.
Unlock Deck
Unlock for access to all 32 flashcards in this deck.
Unlock Deck
k this deck