Ad space (banner)
🖥️Linux Lessons
Lesson 33 / 61

Checking Environment Variables with printenv

printenv is for when "I want to see every environment variable currently set." printenv lists every environment variable set in the current shell, along with its value.

printenv alone shows every environment variable; pass an argument like printenv variable-name, and it shows just that one variable's value.

Running printenv lists every environment variable set by the system or the user — things like PATH and HOME — in name=value format.

A common early mistake is a variable you thought you set with export not showing up — usually because it was set in a different terminal or process, where it's only valid there.

In real work, this is used as a first step in troubleshooting, to confirm a deployment server has the expected environment variables set.

Linux
Try it (type this into the pseudo terminal)
printenv

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)