exam questions

Exam 102-500 All Questions

View all questions & answers for the 102-500 exam

Exam 102-500 topic 1 question 39 discussion

Actual exam question from LPI's 102-500
Question #: 39
Topic #: 1
[All 102-500 Questions]

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

  • A. getargs
  • B. lsenv
  • C. ls
  • D. env
  • E. lsshell
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
bogvt
Highly Voted 3 years, 7 months ago
Wrong answer, "env" displays only environment variables. "set" would be the right answer but is not present as a possible answer option.
upvoted 14 times
Erwinator
2 years, 11 months ago
"displays all environment and shell variables" is in the question
upvoted 2 times
Jodelo
2 years, 2 months ago
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".
upvoted 1 times
...
...
CuriousLinuxCat
2 years, 1 month ago
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.
upvoted 5 times
...
...
klever
Most Recent 8 months, 1 week ago
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
upvoted 2 times
...
drliu1202
1 year, 1 month ago
Selected Answer: D
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.
upvoted 4 times
...
thiagowarwick
1 year, 3 months ago
the correct is "set"
upvoted 1 times
...
lucaverce
1 year, 4 months ago
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???
upvoted 1 times
...
isaac_paul
1 year, 9 months ago
env correct answer as it is verified in the exam too :)
upvoted 2 times
...
MIU
2 years, 9 months ago
"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.
upvoted 4 times
Timfdklfajlksdjlakf
2 years, 1 month ago
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
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago