ExamGecko
Home Home / LPI / 102-500

LPI 102-500 Practice Test - Questions Answers, Page 2

Question list
Search
Search

What is the difference between the commands test -e path and test -f path?

A.
They are equivalent options with the same behaviour.
A.
They are equivalent options with the same behaviour.
Answers
B.
The -f option tests for a regular file. The -e option tests for an empty file.
B.
The -f option tests for a regular file. The -e option tests for an empty file.
Answers
C.
Both options check the existence of the path. The -f option also confirms that it is a regular file.
C.
Both options check the existence of the path. The -f option also confirms that it is a regular file.
Answers
D.
The -f option tests for a regular file. The -e option tests for an executable file.
D.
The -f option tests for a regular file. The -e option tests for an executable file.
Answers
Suggested answer: C

How can the existing environment variable FOOBAR be suppressed for the execution of the script./myscript only?

A.
unset -v FOOBAR;./myscript
A.
unset -v FOOBAR;./myscript
Answers
B.
set -a FOOBAR="";./myscript
B.
set -a FOOBAR="";./myscript
Answers
C.
env -u FOOBAR./myscript
C.
env -u FOOBAR./myscript
Answers
D.
env -i FOOBAR./myscript
D.
env -i FOOBAR./myscript
Answers
Suggested answer: C

When the command echo $$ outputs 12942, what is the meaning of 12942?

A.
It is the process ID of the echo command.
A.
It is the process ID of the echo command.
Answers
B.
It is the process ID of the current shell.
B.
It is the process ID of the current shell.
Answers
C.
It is the process ID of the last command executed.
C.
It is the process ID of the last command executed.
Answers
D.
It is the process ID of the last command which has been placed in the background.
D.
It is the process ID of the last command which has been placed in the background.
Answers
Suggested answer: B

What output will the following command produce? seq 1 5 20

A.
161116
A.
161116
Answers
B.
151015
B.
151015
Answers
C.
1234
C.
1234
Answers
D.
2345
D.
2345
Answers
E.
5101520
E.
5101520
Answers
Suggested answer: A

Which of the following words is used to restrict the records that are returned from a SELECT SQL query based on a supplied criteria for the values in the records?

A.
CASE
A.
CASE
Answers
B.
FROM
B.
FROM
Answers
C.
WHERE
C.
WHERE
Answers
D.
IF
D.
IF
Answers
Suggested answer: C

Which of the following commands lists all defined variables and functions within Bash?

A.
env
A.
env
Answers
B.
set
B.
set
Answers
C.
env -a
C.
env -a
Answers
D.
echo $ENV
D.
echo $ENV
Answers
Suggested answer: B

Which of the following SQL queries counts the number of occurrences for each value of the field order_type in the table orders?

A.
SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
A.
SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
Answers
B.
SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
B.
SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
Answers
C.
COUNT(SELECT order_type FROM orders);
C.
COUNT(SELECT order_type FROM orders);
Answers
D.
SELECT COUNT(*) FROM orders ORDER BY order_type;
D.
SELECT COUNT(*) FROM orders ORDER BY order_type;
Answers
E.
SELECT AUTO_COUNT FROM orders COUNT order_type;
E.
SELECT AUTO_COUNT FROM orders COUNT order_type;
Answers
Suggested answer: B

What is the purpose of the file /etc/profile?

A.
It contains the welcome message that is displayed after login.
A.
It contains the welcome message that is displayed after login.
Answers
B.
It contains security profiles defining which users are allowed to log in.
B.
It contains security profiles defining which users are allowed to log in.
Answers
C.
It contains environment variables that are set when a user logs in.
C.
It contains environment variables that are set when a user logs in.
Answers
D.
It contains default application profiles for users that run an application for the first time.
D.
It contains default application profiles for users that run an application for the first time.
Answers
Suggested answer: C

What command displays all aliases defined in the current shell? (Specify the command without any path information)

A.
alias, alias -p
A.
alias, alias -p
Answers
Suggested answer: A

Which of the following are requirements in order to run a shell script like a regular command from anywhere in the filesystem? (Choose THREE correct answers.)

A.
The user issuing the command must be in the group script.
A.
The user issuing the command must be in the group script.
Answers
B.
The script file must be found in the $PATH.
B.
The script file must be found in the $PATH.
Answers
C.
The script file must have the executable permission bit set.
C.
The script file must have the executable permission bit set.
Answers
D.
The script must begin with a shebang-line (#!) that points to the correct interpreter.
D.
The script must begin with a shebang-line (#!) that points to the correct interpreter.
Answers
E.
The file system on which the script resides must be mounted with the option scripts.
E.
The file system on which the script resides must be mounted with the option scripts.
Answers
Suggested answer: B, C, D
Total 194 questions
Go to page: of 20