Chapter 7
Which environment file is always executed immediately after login for all users on the system, and sets most environment variables, such as HOME and PATH?
/etc/profile
The file descriptor stdin is represented by the number____.
0
You can redirect a file to the standard input of a command using which metacharacter?
<
You can use the BASH shell to redirect standard output and standard error from the terminal screen to a file on the filesystem using which shell metacharacter followed by the absolute or relative pathname of the file?
>
Users can create their own custom variables, called shell variables.
False
When performing a pipe, do you need to have spaces around the | metacharacter?
False
When redirecting both standard output and standard error to a file, does using the same filename for both result in a loss of data?
False
Aliases are shortcuts to commands stored in special variables that can be created and viewed using the alias command.
True
Any command that can be executed on the command line can also be placed inside any environment file.
True
Are both standard output and standard error displayed on the terminal screen by default?
True
The BASH shell assumes stdout in the absence of a numeric file descriptor
True
The ENV environment variable represents the location of the BASH run-time configuration file.
True
The file descriptor stderr is represented by the number 2.
True
You can use the sed command to remove unwanted lines of text.
True
Which test statement would be used to determine if A is numerically greater than B?
[ A -gt B ]
Which escape sequence represents a form feed?
\f
Which command can be used to extract, manipulate, and format text using pattern-action statements?
awk
Most configuration files on Linux systems are delimited using which characters?
colon
Constructs that alter the ow of a program based on whether a command in the program completed successfully or based on a decision that the user makes given a question posed by the program.
decision construct
Which command could be used to view the contents of the environment variable that represents the BASH shell prompt?
echo $PS1
To see a list of all exported environment and user defined variables in the shell, you can use which command?
env
Shell variables that are typically set by the system and contain information that the system and programs access regularly.
environment variables
Labels representing command input and output
file descriptors
The first line in a shell script, which specifies the pathname to the shell that interprets the contents of the shell script.
hashpling
If you have which permission to a shell script, you can execute the shell script like any other executable program on the system?
read and execute
To see a list of the environment variables and their current values on a system, you can use which command?
set
Files that are typically used to create custom programs that perform administrative tasks on Linux systems
shell scripts
The information that is processed by the command during execution.
stdin
The normal output of a command
stdout
A filter command that takes information from standard input and sends that information to a file, as well as to standard output.
tee
Which command can be used to replace characters in a file sent via Standard Input?
tr
Which command counts the number of lines, words, and characters in a file?
wc
You can send the standard output of one command to another command as standard input using which shell metacharacter?
|
Can the redirection shell metacharacter be used to redirect between a command and another command?
False
Can you combine redirection and piping together?
False
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
False
In a decision construct, you can have an unlimited number of if then statements.
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
Any error messages generated by a command
STDERR