CompTIA Linux+ (XK0-004) — Question 72
An administrator notices the HISTSIZE variable is 50, using the commands below:
HISTSIZE=50 -
export HISTSIZE
The administrator rechecks the HISTSIZE value using echo HISTSIZE but gets no value. Which of the following commands should the administrator use to retrieve its value?
Answer options
- A. printenv | grep $HISTSIZE
- B. echo HISTSIZE
- C. printf HISTSIZE
- D. grep $HISTSIZE
Correct answer: B
Explanation
The command 'echo HISTSIZE' is correct because it is meant to print the value of the HISTSIZE variable. However, it needs to be used as 'echo $HISTSIZE' to retrieve the actual value. The other options do not correctly display the value of the HISTSIZE variable, as they either print the variable name or use incorrect syntax.