Which Command Is Used to Display Variable Values in Linux?

Which Command Is Used to Display Variable Values in Linux?
Contents

A list of the commonly used variables in Linux. We use the printf command/echo command to display values of the shell varible in Linux.

Which command is used to display variable values?

Summary:

Command Description
echo $VARIABLE To display value of a variable
env Displays all environment variables
VARIABLE_NAME= variable_value Create a new variable
unset Remove a variable

How do you display a variable in UNIX?

Sh, Ksh, or Bash shell user type the set command. Csh or Tcsh user type the printenv command.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.