Filters
Question type

Study Flashcards

Any command that can be executed on the command line can also be placed inside any environment file.

A) True
B) False

Correct Answer

verifed

verified

​What two BASH environment variables represent the current working directory, and the absolute pathname of the current shell, respectively?


A) ​PWD
B) ​CWD
C) ​PATH
D) ​SHELL

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

Select the escape sequence that starts a new line when used with echo:


A) ​\\
B) ​\a
C) ​\n
D) ​\r

E) C) and D)
F) A) and B)

Correct Answer

verifed

verified

What number represents the stdin file descriptor?


A) 0
B) 1
C) 2
D) 3

E) B) and D)
F) None of the above

Correct Answer

verifed

verified

Explain the while construct, and demonstrate how it can be used.

Correct Answer

verifed

verified

The while construct is a common loop con...

View Answer

In an if construct, what statements are optional?​


A) ​fi
B) ​elif
C) ​else
D) ​then

E) All of the above
F) C) and D)

Correct Answer

verifed

verified

The ____________________ environment variable contains a list of directories to search for executable programs.

Correct Answer

verifed

verified

PATH

​What operator below is known as the NOT operator?


A) ​-o
B) ​-a
C) ​!
D) ​%

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

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 ]

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

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) |

E) A) and D)
F) All of the above

Correct Answer

verifed

verified

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

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

A

What character is used to delimit most Linux configuration files?


A) tab
B) colon
C) space
D) semicolon

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

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

E) A) and C)
F) None of the above

Correct Answer

verifed

verified

Describe what file descriptors are, and then list three that can be used within the BASH shell, and discuss how they can be used.

Correct Answer

verifed

verified

Command input and output are represented by labels known as file descriptors. For each command that can be manipulated by the BASH shell, there are three file descriptors: Standard input (stdin) Standard output (stdout) Standard error (stderr) Standard input (stdin) refers to the information processed by the command during execution; this often takes the form of user input typed on the keyboard. Standard output (stdout) refers to the normal output of a command, whereas standard error (stderr) refers to any error messages generated by the command. Both stdout and stderr are displayed on the terminal screen by default.

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

E) B) and D)
F) A) and C)

Correct Answer

verifed

verified

Select the escape sequence that is used for a form feed:


A) \n
B) \f
C) /f
D) /n

E) B) and C)
F) A) and C)

Correct Answer

verifed

verified

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.

A) True
B) False

Correct Answer

verifed

verified

​Match each correct item with the statement below.​ a.​counter variable b.decision construct​ c.​environment variables d.​file descriptors e.​hashpling f.loop construct​ g.​redirection h.Standard Error (stderr)​ i.​Standard Input (stdin) j.Standard Output (stdout) -​A special construct used in a shell script to alter the flow of the program based on the outcome of a command or contents of a variable. Common decision constructs include if, case, &&, and ||.

Correct Answer

verifed

verified

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

E) None of the above
F) A) and D)

Correct Answer

verifed

verified

The ability to extract, manipulate, and format text using pattern action statements belongs to which command below?


A) sed
B) grep
C) awk
D) nl

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer