Linux printenv command

Updated: 04/26/2017 by Computer Hope

About printenv

printenv prints all or part of the environment.

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.

printenv examples

printenv HOME

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


Display the values of all environment variables.

env — Report the value of environment variables.