Linux printenv command

Updated: 05/04/2019 by Computer Hope
printenv command

On Unix-like operating systems, the printenv command prints all or part of the shell environment.

This document describes the GNU/Linux version of printenv.

Syntax

printenv [OPTION]... [VARIABLE]...

printenv prints the values of the specified environment VARIABLE(s). If no VARIABLE is specified, print name and value pairs for them all.

NOTE: your shell may have its own version of printenv, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports.

-0, --null End each output line with 0 byte rather than newline.
--help Display a help message, and exit.

Examples

printenv HOME

Display the location of the current user's home directory.

printenv

Display the values of all environment variables.

env — Report the value of environment variables.