Which of the following commands lists all defined variables and functions within Bash?
Suggested Answer: B, C
Get Premium LFCS Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
30 comments · newest first
SH
Shay
12 months ago
Really? I had no idea set did that!
ME
Meaghan
1 year ago
Nope, env just lists environment variables, not all.
JE
Jesusa
1 year ago
Wait, I thought env was the right one?
AL
Allene
1 year ago
Totally agree, set shows all variables!
FR
France
1 year ago
The correct command is B, set.
VA
Valene
1 year ago
I remember a question like this in practice, and I think "set" was the right answer for showing all variables and functions.
DO
Dong
1 year ago
I vaguely recall something about "env -a," but I don't think it lists everything. Could it be "set"?
TR
Tricia
1 year ago
I feel like "env" just shows the environment variables, not all defined ones. Maybe it's "set"?
RO
Rosendo
1 year ago
I think the command to list all variables is "set," but I'm not completely sure. I remember practicing with it.
RO
Ronald
1 year ago
I've used 'set' before to list variables, so I'm leaning towards that as the answer. But I want to make sure I'm not missing something, so I'll quickly review the other options too.
YA
Yasuko
1 year ago
Okay, let me think this through. I know 'env' lists environment variables, but I'm not sure if that includes user-defined variables and functions. I'll have to double-check the Bash documentation on this.
RO
Roosevelt
1 year ago
Hmm, I'm a bit confused on this one. I think it might be C, 'env -a', but I'm not 100% sure.
AU
Audra
1 year ago
I'm pretty sure the answer is B. The 'set' command lists all defined variables and functions in Bash.
CH
Cherelle
2 years ago
Whoever came up with D. echo $ENV as an option must be living in a different universe. That's just silly.
LO
Louvenia
2 years ago
The correct answer has to be B. set. I remember learning that in my Bash scripting class.
CH
Chu
1 year ago
Thanks for the reminder. I'll remember that for next time.
JU
Judy
1 year ago
Oh, you're right. It is B) set.
RO
Romana
1 year ago
No, I'm pretty sure it's B) set.
LE
Leonora
1 year ago
I think it's A) env.
RE
Reuben
2 years ago
I was thinking C. env -a, but now I'm second-guessing myself. Hmm, tough choice.
SH
Shelton
2 years ago
B) set
CO
Cory
2 years ago
A) env
GE
Geoffrey
2 years ago
I'm not sure, but I think A) env might also be a possible answer.
FR
Francene
2 years ago
I agree with you, Carmela. The set command lists all defined variables and functions in Bash.
AV
Avery
2 years ago
B. set is the way to go, no doubt about it. It's like the Swiss Army knife of Bash commands.
SH
Shawnna
2 years ago
D) echo $ENV
TR
Trinidad
2 years ago
C) env -a
FR
Fredric
2 years ago
B) set
LU
Luis
2 years ago
A) env
CA
Carmela
2 years ago
I think the answer is B) set.