# proc_pid_environ - initial environment - man(5) - [phpMan]

[_proc_pid_environ_(5)](https://www.chedong.com/phpMan.php/man/procpidenviron/5/markdown)                      File Formats Manual                     [_proc_pid_environ_(5)](https://www.chedong.com/phpMan.php/man/procpidenviron/5/markdown)

## NAME
       /proc/pid/environ - initial environment

## DESCRIPTION
       _/proc/_pid_/environ_
              This  file  contains the initial environment that was set when the currently executing
              program was started via [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown).  The entries are separated by  null  bytes  ('\0'),
              and  there  may  be  a  null  byte  at the end.  Thus, to print out the environment of
              process 1, you would do:

                  $ **cat /proc/1/environ | tr '\000' '\n'**

              If, after an [**execve**(2)](https://www.chedong.com/phpMan.php/man/execve/2/markdown), the process modifies its environment (e.g., by  calling  func‐
              tions such as [**putenv**(3)](https://www.chedong.com/phpMan.php/man/putenv/3/markdown) or modifying the [**environ**(7)](https://www.chedong.com/phpMan.php/man/environ/7/markdown) variable directly), this file will
              _not_ reflect those changes.

              Furthermore,  a  process  may  change  the  memory  location that this file refers via
              [**prctl**(2)](https://www.chedong.com/phpMan.php/man/prctl/2/markdown) operations such as **PR_SET_MM_ENV_START**.

              Permission  to  access   this   file   is   governed   by   a   ptrace   access   mode
              **PTRACE_MODE_READ_FSCREDS **check; see [**ptrace**(2)](https://www.chedong.com/phpMan.php/man/ptrace/2/markdown).

## SEE ALSO
       [**proc**(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown)

Linux man-pages 6.7                          2023-08-15                          [_proc_pid_environ_(5)](https://www.chedong.com/phpMan.php/man/procpidenviron/5/markdown)
