Terminal Basics
Help 7 / 8
Pipelines

Environment variables

Finally, let’s explore environment variables. For example, to define a variable abc with contents 123, and def with hello:

abc=123
def=hello

Make sure there are no spaces surrounding the equal sign, otherwise the terminal treats the variable name as a command (try it!).

To display the content of the variable abc, use the $ delimiter:

echo $abc

To delete a variable, use unset:

unset abc

Use env to view all available variables:

env
Loading...