How to list all variables names and their current values?
Including not only $HOME
, $PWD
etc but any other you have defined.
bashcommand lineenvironment-variables
How to list all variables names and their current values?
Including not only $HOME
, $PWD
etc but any other you have defined.
Best Answer
For bash: (the standard shell in Ubuntu)
Enter the following command in a terminal to print all the environment variables:
For further information about this command, read the
printenv
man page.To show a list including the "shell variables" you can enter the next command:
This will show you not only the shell variables, but the environment variables too.
For more information related with this topic read:
For zsh: (an advanced shell)
Use the following command:
For more information about ZSH options, see
zshoptions
man page.