Linux List All Environment Variables Command

You can use the following command to list all environment variables in Linux:

 
printenv

This will display a list of all the environment variables and their values. To view a specific environment variable, you can use the following syntax:

 
echo $VARIABLE_NAME

Replace VARIABLE_NAME with the name of the environment variable you want to view. For example, to view the value of the PATH environment variable, you can use the following command:

 
echo $PATH

Leave a Comment