Back to DevOps Series

Environment Variables in WSL :

1. View Environment Variables

Show all:
Loading...
Loading...
Show a specific variable:
Loading...

2. Create a Temporary Environment Variable

Works only in the current terminal session:
Loading...
Use it:
Loading...

3. Create a Permanent Environment Variable

For Bash, edit:
Loading...
Add:
Loading...
Apply changes:
Loading...

4. Remove an Environment Variable

Loading...

5. Environment Variable for One Command

Available only for that command:
Loading...
Example:
Loading...

6. Common Environment Variables

Variable
Meaning
$HOME
User's home directory
$USER
Current username
$PATH
Directories searched for commands
$SHELL
Current shell
$PWD
Current directory
$OLDPWD
Previous directory

Key Point

Temporary:
Loading...
Permanent:
Loading...
Remove:
Loading...