Inspirational journeys

Follow the stories of academics and their research expeditions

Comptia Linux + 2023 Questions and answer - Part 19

Mary Smith

Sat, 12 Jul 2025

Comptia Linux + 2023 Questions and answer - Part 19

1. Which of the following commands are used to manage the environment and shell variables within a shell process? (Choose TWO correct answers.)(Select 2answers)

A) A. export
B) B. init
C) C. reset
D) D. set
E) E. tset


2. Which of the following are operators used for comparisons by the test command? (Choose TWO correct answers.)(Select 2answers)

A) A. equals
B) B. =
C) C. -is
D) D. -eq
E) E. null


3. Which of the following commands creates a function in Bash that outputs the sum of two numbers?

A) A. function sumitup { echo $(($1 + $2)) ; }
B) B. command sumitup { echo $(($1 + $2)) ; }
C) C. function sumitup { echo $1 + $2 ; }
D) D. method sumitup { echo $1 + $2 ; }
E) E. command sumitup { echo $1 + $2 ; }


4. What output will the following command sequence produce?echo '1 2 3 4 5 6' | while read a b c; do echo result: $c $b $a; done

A) A. result: 3 4 5 6 2 1
B) B. result: 1 2 3 4 5 6
C) C. result: 6 5 4
D) D. result: 6 5 4 3 2 1
E) E. result: 3 2 1


5. When the command echo $? outputs 1, which of the following statements are true?

A) A. It is the process ID of the echo command.
B) B. It is the process ID of the current shell.
C) C. It is the exit value of the command executed immediately before echo.
D) D. It is the exit value of the echo command.



1. Right Answer: A,D
Explanation:

2. Right Answer: B,D
Explanation:

3. Right Answer: A
Explanation:

4. Right Answer: A
Explanation:

5. Right Answer: C
Explanation:

0 Comments

Leave a comment