# Linux commands: printenv

> Learn how the Linux printenv command prints all of your environment variables, or just one like PATH when you pass its name as an argument.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-10-18 | Topics: [CLI](https://flaviocopes.com/tags/cli/) | Canonical: https://flaviocopes.com/linux-command-printenv/

A quick guide to the `printenv` command, used to print the values of environment variables

In any shell there are a good number of 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
```

with a few more lines, usually.

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

```bash
printenv PATH
```

![Terminal showing printenv PATH command output displaying the PATH environment variable value](https://flaviocopes.com/images/linux-command-printenv/Screen_Shot_2020-09-10_at_16.31.20.png)

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