CompTIA Linux+ Chapter 7 Quiz - 'Shell Scripts'
The escape sequence that is used for a form feed:
/f
Select the two escape sequences that represent a horizontal tab and a vertical tab, respectively:
/v AND /t
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.
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
What two BASH environment variables represent the current working directory, and the absolute pathname of the current shell, respectively?
PWD and SHELL
You can use the sed command to remove unwanted lines of text. True or False?
True
The ability to extract, manipulate, and format text using pattern action statements belongs to which command below?
awk
The default BASH shell prompt is set by an environment variable. What command can be used to view this variable?
echo $PS1
Any command that can take standard input and transform it into standard output is called
filter command
What permissions are required to execute a shell script in a manner similar to any other executable program on the system?
read and execute
Which command can be used to count the number lines, words, and characters in a file?
wc
Two commands that will provide the number of lines in a file, and the number of characters in a file, respectively:
wc -c AND wc -l
What two files below are the first two BASH environment files to be executed?
/etc/bashrc AND /etc/profile
What operator below is known as the NOT operator?
!
What number represents the stdin file descriptor?
0
What number represents the stderr file descriptor?
2
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?
>