How to display ENV variables on our local terminal

Nazif Altintas
1 min readJul 17, 2023

--

To display environment variables on a local terminal, you can use the following commands based on your operating system:

Windows:

Open the Command Prompt and run the command:

set

This command will display a list of all environment variables along with their values in the current Command Prompt session.

Alternatively, if you want to display the value of a specific environment variable, you can use the echo command as follows:

echo %VARIABLE_NAME%

Replace VARIABLE_NAME with the name of the environment variable you want to display.

macOS/Linux:

Open a terminal and run the command:

echo $VARIABLE_NAME

Replace VARIABLE_NAME with the name of the environment variable you want to display.

Alternatively, you can use the printenv command to display all environment variables:

printenv

These commands will output the value of the specified environment variable or display a list of all environment variables set in the current terminal session.

How to set ENV variables on our local terminal?

--

--