---
name: "printenv"
section: "1"
platform: "macos"
package: "shell_cmds"
version: "329"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "openbsd", "macos"]
url: "https://new.carta.tech/printenv"
---

# printenv(1)

print out the environment

## NAME

**printenv** – print out the environment

## SYNOPSIS

**printenv** \[*name*\]

## DESCRIPTION

The **printenv** utility prints out the names and values of the variables in the environment, with one name/value pair per line. If *name* is specified, only its value is printed.

Some shells may provide a builtin **printenv** command which is similar or identical to this utility. Consult the [builtin(1)](/builtin/1.md) manual page.

## EXIT STATUS

The **printenv** utility exits 0 on success, and \>0 if an error occurs.

## SEE ALSO

[csh(1)](/csh/1.md), [env(1)](/env/1.md), [sh(1)](/sh/1.md), [environ(7)](/environ/7.md)

## STANDARDS

The **printenv** utility is provided for compatibility with earlier BSD and FreeBSD releases and is not specified by any standards. The functionality of **printenv** can be duplicated with the [echo(1)](/echo/1.md) and [env(1)](/env/1.md) utilities.

## HISTORY

The **printenv** command appeared in 3.0BSD.
