Home

printenv

Printenv is a standard Unix utility that prints environment variables for the current process. It reads the process’s environment and outputs lines in the form NAME=value. When invoked without arguments, printenv prints all environment variables; when given one or more names, it prints only the values for the specified variables that are defined.

Usage and behavior: The syntax is typically printenv [NAME]... If a requested NAME is defined, printenv outputs

Common usage and examples: printenv PATH prints the search path used by the system to locate executables.

Implementation and scope: Printenv is commonly included in the GNU coreutils package on Linux and other Unix-like

NAME=value.
If
a
requested
NAME
is
not
defined,
nothing
is
printed
for
that
name.
Each
variable
is
typically
printed
on
its
own
line.
The
command
does
not
modify
the
environment;
it
only
displays
it.
printenv
HOME
prints
the
user’s
home
directory.
Combined
with
other
utilities,
it
is
often
used
in
scripts,
for
example
to
extract
a
specific
variable
or
to
filter
output
with
grep
(printenv
|
grep
VARIABLE).
systems.
It
is
not
a
shell
built-in
in
most
environments;
it
is
a
separate
program
that
reads
the
environment
of
the
running
process.
A
related
utility,
env,
can
run
a
command
with
a
modified
environment,
whereas
printenv
simply
prints
the
existing
environment.