Forrest logo
back to the printenv tool

printenv:tldr:d3bc3

printenv: Display key-value pairs of all environment variables.
$ printenv
try on your machine

The command "printenv" is a Unix/Linux command used to print all or specific environment variables. An environment variable is a named value that is stored within the operating system and can be accessed by various programs and processes.

When you run the "printenv" command without any arguments, it displays the values of all environment variables currently set in your system. Each variable is printed on a new line in the format "variable=value".

For example, if you run "printenv" command, you may see output like:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/home/user USER=user LANG=en_US.UTF-8

This output shows the values of some common environment variables like PATH, HOME, USER, LANG, etc.

You can also provide the name of a specific environment variable as an argument to the "printenv" command to display only its value. For instance, running "printenv PATH" will print the value of the PATH variable: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin".

Overall, "printenv" is a handy command for checking the environment variables and their values in Unix/Linux systems.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the printenv tool