ITS 121 Quiz 2 Study Guide for Chapter 7
Select the escape sequence that is used for a form feed: A. \n B. \f C. /f D. /n
B
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. True or False?
False
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. True or False?
False
You are limited to using one pipe | metacharacter on the command line to pipe information from one command to another command. True or False?
False
Any command that can be executed on the command line can also be placed inside any environment file. True or False?
True
You can use the sed command to remove unwanted lines of text. True or False?
True
Select the escape sequence that starts a new line when used with echo: A. \\ B. \a C. \n D. \r
C
Select the test statement that can 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 ]
C
The ability to extract, manipulate, and format text using pattern action statements belong to which command below? A. sed B. grep C. awk D. nl
C
The default BASH shell prompt is set by an environment variable. What command can be used to view this variable? A. ls $PWD B. echo #PWD C. echo $PS1 D. ls #PS1
C
The environment variables that are set by default and their current values can be viewed with what command? A. env B. get C. set D. setenv
C
The standard output and standard error from a terminal screen within the BASH shell can be redirected to a file on the filesystem using what shell metacharacter, followed by the absolute or relative pathname of the file? A. # B. < C. > D. |
C
What 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
C
What number represents the stderr file descriptor? A. 0 B. 1 C. 2 D. 3
C
What operator below is known as the NOT operator? A. -o B. -a C. ! D. %
C
In order to redirect a file to the standard input of a command, what metacharacter should be used? A. > B. # C. | D. <
D
What permissions are required to execute a shell script in a manner similar to any other executable program on the system? A. read B. write and read C. execute D. read and execute
D
Which command can be used to count the number lines, words, and characters in a file? A. pr B. nl C. tr D. wc
D
A list of all exported environment and user-defined variables in a shell can be viewed with what command below? A. env B. set C. setenv D. getenv
A
What command can be used to replace characters in a file sent via Standard Input? A. tr B. rt C. ts D. st
A
What construct is intended for use in processing a list of objects, such as files, directories, users, printers, and so on? A. for B. while C. case D. switch
A
What number represents the stdin file discriptor? A. 0 B. 1 C. 2 D. 3
A
Select the metacharacter that can be used to send the standard output of one command to another command as standard input: A. < B. | C. > D. #
B
What character combination at the start of a shell script are referred to as a hashpling, and allow for the specification of the shell that interprets the contents of the script? A. @! B. #! C. // D. ->
B
What character is used to delimit most Linux configuration files? A. tab B. colon C. space D. semicolon
B