To list all variables in a Linux environment, you can use the set command. This command will display all shell variables and functions. Here’s how to do it:
Open your terminal.
Type the following command and press Enter:
set
This will output a list of all variables and their values.
If you want to list only environment variables, you can use the printenv command:
printenv
Alternatively, you can also use the env command:
env
Both printenv and env will show you the environment variables currently set in your session.
