AI Workshop: learn to build apps with AI →
System Information: printenv - Print Environment

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


A quick guide to the printenv command, which prints the values of environment variables.

In any shell there are many environment variables, set either by the system, or by your own shell scripts and configuration.

You can print them all to the terminal using the printenv command. The output will be something like this:

HOME=/Users/flavio
LOGNAME=flavio
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
PWD=/Users/flavio
SHELL=/usr/local/bin/fish

usually with a few more lines.

You can append a variable name as a parameter, to only show that variable value:

printenv PATH

The printenv command works on Linux, macOS, WSL, and anywhere you have a UNIX environment

Lessons in this unit:

0: Introduction
1: uname - System Information
2: whoami - Current User
3: who - Logged In Users
4: df - Disk Free Space
5: du - Disk Usage
6: ps - Process Status
7: top - Task Manager
8: env - Environment Variables
9: ▶︎ printenv - Print Environment
10: Linux, no space left on device
11: How to find the process that is using a port