Test 3 Flashcards
(130 cards)
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.
1) True
2) False
2) False
You are limited to using one pipe | metacharacter on the command line to pipe information from one command to another command.
1) True
2) False
1) True
You can use the sed command to remove unwanted lines of text.
1) True
2) False
1) True
Any command that can be executed on the command line can also be placed inside any environment file.
1) True
2) False
1) True
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.
1) True
2) False
2) False
The BASH shell assumes stdout in the absence of a numeric file descriptor.
1) True
2) False
1) True
Users can create their own custom variables, called shell variables.
1) True
2) False
2) False
The ENV environment variable represents the location of the BASH run-time configuration file.
1) True
2) False
1) True
Aliases are shortcuts to commands stored in special variables that can be created and viewed using the alias command.
1) True
2) False
1) True
In a decision construct, you can have an unlimited number of if then statements.
1) True
2) False
2) False
The file descriptor stdin is represented by the number ____.
1) 0
2) 1
3) 2
4) 3
1) 0
The file descriptor stderr is represented by the number ____.
1) 0
2) 1
3) 2
4) 3
3) 2
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.
1) #
2)
4) |
3) >
You can redirect a file to the standard input of a command using the ____ metacharacter.
1) >
2) #
3) |
4) <
4) <
The ____ command can be used to replace characters in a file sent via Standard Input.
1) tr
2) rt
3) ts
4) st
1) tr
You can send the standard output of one command to another command as standard input using the ____ shell metacharacter.
1) <
2) |
3) >
4) #
2) |
The ____ command counts the number of lines, words, and characters in a file.
1) pr
2) nl
3) tr
4) wc
4) wc
The ____ command can be used to extract, manipulate, and format text using pattern-action statements.
1) sed
2) grep
3) awk
4) nl
3) awk
Most configuration files on Linux systems are delimited using ____ characters.
1) tab
2) colon
3) space
4) semicolon
2) colon
To see a list of the environment variables and their current values on a system, you can use the ____ command.
1) env
2) get
3) set
4) setenv
3) set
The ____ command could be used to view the contents of the environment variable that represents the BASH shell prompt.
1) ls $PWD
2) echo #PWD
3) echo $PS1
4) ls #PS1
3) echo $PS1
To see a list of all exported environment and user-defined variables in the shell, you can use the ____ command.
1) env
2) set
3) setenv
4) getenv
1) env
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.
1) ~/.bash_profile
2) ~/.bash_login
3) /etc/profile
4) ~/.profile
3) /etc/profile
If you have ____ permission to a shell script, you can execute the shell script like any other executable program on the system.
1) read
2) write and read
3) execute
4) read and execute
4) read and execute