ExamGecko
Home / LPI / 102-500 / List of questions
Ask Question

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

Add to Whishlist

List of questions

Question 11

Report Export Collapse

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

They are equivalent options with the same behaviour.
They are equivalent options with the same behaviour.
The -f option tests for a regular file. The -e option tests for an empty file.
The -f option tests for a regular file. The -e option tests for an empty file.
Both options check the existence of the path. The -f option also confirms that it is a regular file.
Both options check the existence of the path. The -f option also confirms that it is a regular file.
The -f option tests for a regular file. The -e option tests for an executable file.
The -f option tests for a regular file. The -e option tests for an executable file.
Suggested answer: C
asked 18/09/2024
Jonathan Steeman
40 questions

Question 12

Report Export Collapse

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

unset -v FOOBAR;./myscript
unset -v FOOBAR;./myscript
set -a FOOBAR="";./myscript
set -a FOOBAR="";./myscript
env -u FOOBAR./myscript
env -u FOOBAR./myscript
env -i FOOBAR./myscript
env -i FOOBAR./myscript
Suggested answer: C
asked 18/09/2024
gregori carmona lorenzo
45 questions

Question 13

Report Export Collapse

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

It is the process ID of the echo command.
It is the process ID of the echo command.
It is the process ID of the current shell.
It is the process ID of the current shell.
It is the process ID of the last command executed.
It is the process ID of the last command executed.
It is the process ID of the last command which has been placed in the background.
It is the process ID of the last command which has been placed in the background.
Suggested answer: B
asked 18/09/2024
Harri rrapaj
34 questions

Question 14

Report Export Collapse

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

1 6 1 1 1 6
1 6 1 1 1 6
1 5 10 15
1 5 10 15
1 2 3 4
1 2 3 4
2 3 4 5
2 3 4 5
5 10 15 20
5 10 15 20
Suggested answer: B
Explanation:

The seq command in Linux is used to generate a sequence of numbers from FIRST to LAST insteps of INCREMENT1. The syntax for the seq command is:seq [OPTION]... LAST or seq [OPTION]... FIRST LAST or seq [OPTION]... FIRST INCREMENT LASTIn this case, the command seq 1 5 20 has three arguments: FIRST = 1, INCREMENT = 5, and LAST= 20. This means that the command will produce numbers from 1 to 20 in steps of 5. Theoutput will be:1 5 10 15The output will not include 20 because it is not a multiple of 5.The output will be printed onseparate lines by default, unless a different separator is specified with the -s option2.Reference:Seq Command in Linux [Explained With Examples]seq Man Page - Linux - SS64.com - SS64 Command line reference

asked 18/09/2024
umar raad
38 questions

Question 15

Report Export Collapse

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?

CASE
CASE
FROM
FROM
WHERE
WHERE
IF
IF
Suggested answer: C
asked 18/09/2024
Bipindra Shrestha
45 questions

Question 16

Report Export Collapse

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

env
env
set
set
env -a
env -a
echo $ENV
echo $ENV
Suggested answer: B
asked 18/09/2024
Marcos Losa Torviso
58 questions

Question 17

Report Export Collapse

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

SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
COUNT(SELECT order_type FROM orders);
COUNT(SELECT order_type FROM orders);
SELECT COUNT(*) FROM orders ORDER BY order_type;
SELECT COUNT(*) FROM orders ORDER BY order_type;
SELECT AUTO_COUNT FROM orders COUNT order_type;
SELECT AUTO_COUNT FROM orders COUNT order_type;
Suggested answer: B
asked 18/09/2024
Ankit Parimi
38 questions

Question 18

Report Export Collapse

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

It contains the welcome message that is displayed after login.
It contains the welcome message that is displayed after login.
It contains security profiles defining which users are allowed to log in.
It contains security profiles defining which users are allowed to log in.
It contains environment variables that are set when a user logs in.
It contains environment variables that are set when a user logs in.
It contains default application profiles for users that run an application for the first time.
It contains default application profiles for users that run an application for the first time.
Suggested answer: C
asked 18/09/2024
Channa Leang
46 questions

Question 19

Report Export Collapse

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

alias, alias -p
alias, alias -p
Suggested answer: A
asked 18/09/2024
Patrick Neason
44 questions

Question 20

Report Export Collapse

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

The user issuing the command must be in the group script.
The user issuing the command must be in the group script.
The script file must be found in the $PATH.
The script file must be found in the $PATH.
The script file must have the executable permission bit set.
The script file must have the executable permission bit set.
The script must begin with a shebang-line (#!) that points to the correct interpreter.
The script must begin with a shebang-line (#!) that points to the correct interpreter.
The file system on which the script resides must be mounted with the option scripts.
The file system on which the script resides must be mounted with the option scripts.
Suggested answer: B, C, D
asked 18/09/2024
Arnaud Dutel
38 questions
Total 235 questions
Go to page: of 24