Linux Tip: How to see the value of an environment variable

Linux Tip: How to see the value of an environment variable
Photo by NOAA / Unsplash

Environment variables in Linux are essential components that store configuration data for processes running in the system. These variables can define system-wide settings like the location of system files or user-specific settings, such as paths to directories or API keys.

To see the value of an environment variable in Linux, you can use the following command in the terminal:

echo $VARIABLE_NAME

For example, to check the value of the PATH environment variable, you would run:

echo $PATH

If you want to list all environment variables, use the printenv or env command:

printenv

or

env

This will display a list of all environment variables along with their current values.

That's all, easy right?

Support Us

Subscribe to Buka Corner

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe