Linux Foundation Certified System Administrator (LFCS) — Question 137
Which of the following commands lists all defined variables and functions within Bash?
Answer options
- A. env
- B. set
- C. env -a
- D. echo $ENV
Correct answer: B
Explanation
The command 'set' is the correct choice because it displays all defined variables and functions in the current shell session. The 'env' command shows the environment variables but does not list functions, while 'env -a' is not a standard command for displaying defined variables, and 'echo $ENV' simply displays the value of the ENV variable if it is set.