102-500 Exam QuestionsBrowse all questions from this exam

102-500 Exam - Question 39


Which of the following commands displays all environment and shell variables?

Show Answer
Correct Answer: D

The correct answer is 'env'. The 'env' command is used to display all the environment variables in the shell. While it is true that 'set' would display both environment and shell variables, among the provided options, 'env' is the closest and most accurate command to fulfill the requirement of displaying environment variables.

Discussion

7 comments
Sign in to comment
bogvtOption: D
Feb 16, 2020

Wrong answer, "env" displays only environment variables. "set" would be the right answer but is not present as a possible answer option.

Erwinator
Sep 28, 2020

"displays all environment and shell variables" is in the question

Jodelo
Jul 5, 2021

Yeah, and that's the wrong answer since "env", like bogvt already said, only displays environment variables, NOT shell variables. If you wanna list both, you have to use "set".

CuriousLinuxCat
Aug 6, 2021

I agree with "set". Since the question asks for ALL environment and shell variables, you NEED to use "set". "env" will only see environment variables.

MIUOption: D
Nov 26, 2020

"The commands env , set , and printenv display all environment variables and their values." If you can see environment variables, it means you can see both of environment and variables. So, the answer is env.

Timfdklfajlksdjlakf
Jul 18, 2021

No, it's not! It never was and it never will. That answer of yours is WRONG. Read the man pages properly dude and stop spreading false information man. Bogvt is right

drliu1202Option: D
Aug 11, 2022

The better answer is 'set'. In these four options, I choose 'env'. "set outputs all of the currently assigned shell variables and functions." https://learning.lpi.org/en/learning-materials/102-500/105/105.1/105.1_02/#:~:text=set%20outputs%20all%20of%20the%20currently%20assigned%20shell%20variables%20and%20functions.

isaac_paulOption: D
Dec 16, 2021

env correct answer as it is verified in the exam too :)

kleverOption: D
Jan 9, 2023

From these options if you try out in the terminal emulator only the env and ls is working so from the possible answers available here env is the best one but I agree that set should be available as an option

lucaverceOption: D
May 13, 2022

The correct answer, that's definitively "set" , is not listed between possible answers. So, answer "env" may be the best worst answer? Or it's just a wrong transcrition from the dump???

thiagowarwick
May 27, 2022

the correct is "set"