---
name: "procenv"
section: "1"
platform: "linux"
package: "procenv"
version: "0.51-0.2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/procenv"
---

# procenv(1)

display process environment details

## NAME

procenv - display process environment details

## SYNOPSIS

**procenv** \[*OPTION*\]

## DESCRIPTION

Display details of the process environment in a parseable format.

## OPTIONS

Options shown with a bracketed asterisk '(\*)' are non-display options and must preceed any other (display) options.

- **-a**, **--meta**

  Display meta details.

- **-A**, **--arguments**

  Display program arguments.

- **-b**, **--libs**

  Display details of linked libraries. See [**dl\_iterate\_phdr**(3)](/dl_iterate_phdr/3.md).

- **-B**, **--libc**

  Display standard library details. See [**feature\_test\_macros**(7)](/feature_test_macros/7.md) (Linux).

- **-c**, **--cgroups**

  Display cgroup details (Linux only). See [**proc**(5)](/proc/5.md).

- **-C**, **--cpu**

  Display CPU and scheduler details. See [**kvm\_getprocs**(3)](/kvm_getprocs/3.md) (BSD),  [**pthread\_getaffinity\_np**(3)](/pthread_getaffinity_np/3.md)**,**  [**sched\_getcpu**(3)](/sched_getcpu/3.md) (Linux).

- **--crumb-separator=***str* (\*)

  Specify string *str* as alternate delimiter for crumb format output (default=':').

- **-d**, **--compiler**

  Display compiler details. See [**cpp**(1)](/cpp/1.md), [**cc**(1)](/cc/1.md) and [**feature\_test\_macros**(7)](/feature_test_macros/7.md) (Linux).

- **-e**, **--environment**

  Display environment variables. See [**environ**(7)](/environ/7.md).

- **-E**, **--semaphores**

  Display semaphore details (not queryable on BSD). See [**semctl**(2)](/semctl/2.md).

- **--exec** (\*)

  Treat non-option arguments as program to execute after running **procenv**. See [**exec**(3)](/exec/3.md).

- **-f**, **--fds**

  Display file descriptor details. Under FreeBSD, file descriptor capabilities will also be displayed assuming the kernel has Capsicum support. See [**cap\_getmode**(2)](/cap_getmode/2.md) (BSD),  **cap\_rights\_get**(2) (BSD),  [**cap\_rights\_is\_set**(3)](/cap_rights_is_set/3.md) (BSD),  [**fcntl**(2)](/fcntl/2.md),  **isatty**(5).

- **-F**, **--namespaces**

  Display namespace details (Linux only). See [**proc**(5)](/proc/5.md).

- **--file=***FILE* (\*)

  Send output to file *FILE* (implies **--output=file**).

- **--file-append** (\*)

  If **--file** is specifed, append to it rather than overwriting it.

- **--format=***FORMAT* (\*)

  Specify output format. *FORMAT* may be one of:

  - •

    *crumb* ("breadcrumbs").

  - •

    *json* (JavaScript Object Notation).

  - •

    *text* (plain ASCII text) \[default\].

  - •

    *xml* (Extensible Markup Language).

- **-g**, **--sizeof**

  Display sizes of data types.

- **-h**, **--help**

  This help text.

- **-i**, **--misc**

  Display miscellaneous details. See **umask**(P),  [**getcwd**(3)](/getcwd/3.md),  [**personality**(2)](/personality/2.md) (Linux),  [**proc**(5)](/proc/5.md),  [**prctl**(2)](/prctl/2.md),  [**aa\_getcon**(2)](/aa_getcon/2.md) (Linux),  [**getpidcon**(3)](/getpidcon/3.md) (Linux),  [**sysconf**(3)](/sysconf/3.md),  [**kvm\_getprocs**(3)](/kvm_getprocs/3.md) (BSD),  [**getpriority**(2)](/getpriority/2.md).

- **--indent** (\*)

  Number of indent characters to use for each indent (default=2).

- **--indent-char=***c* (\*)

  Use character *c* for indenting (default=' ' (space)).

- **-j**, **--uname**

  Display uname details. See [**uname**(2)](/uname/2.md).

- **-k**, **--clocks**

  Display clock details. See [**clock\_getres**(2)](/clock_getres/2.md).

- **-l**, **--limits**

  Display limits. See [**getrlimit**(2)](/getrlimit/2.md).

- **-L**, **--locale**

  Display locale details. See [**setlocale**(3)](/setlocale/3.md) and [**locale**(7)](/locale/7.md).

- **-m**, **--mounts**

  Display mount details. See [**getmntent**(3)](/getmntent/3.md) and [**statfs**(2)](/statfs/2.md) (Linux), and [**getmntinfo**(3)](/getmntinfo/3.md) (BSD).

- **-M**, **--message-queues**

  Display message queue details (not queryable on BSD). See [**msgctl**(2)](/msgctl/2.md).

- **-n**, **--confstr**

  Display confstr details. See **confstr**(5).

- **-N**, **--network**

  Display network details. See [**getifaddrs**(3)](/getifaddrs/3.md), [**getnameinfo**(3)](/getnameinfo/3.md), [**ip**(7)](/ip/7.md), [**netdevice**(7)](/netdevice/7.md), and [**ioctl**(2)](/ioctl/2.md) **(Linux)**.

- **-o**, **--oom**

  Display out-of-memory manager details (Linux only). See [**proc**(5)](/proc/5.md).

- **--output=***TYPE* (\*)

  Send output to alternative location. *TYPE* can be one of:

  - •

    *file* (send output to a file).

  - •

    *stderr* (write to standard error).

  - •

    *stdout* (write to standard output (default)).

  - •

    *syslog* (write to the system log file).

  - •

    *terminal* (write to terminal).

- **-p**, **--process**

  Display process details. See [**getpid**(2)](/getpid/2.md),  [**getppid**(2)](/getppid/2.md),  [**getresuid**(2)](/getresuid/2.md),  [**getresgid**(2)](/getresgid/2.md),  [**getuid**(2)](/getuid/2.md),  [**geteuid**(2)](/geteuid/2.md),  [**getgid**(2)](/getgid/2.md),  [**getegid**(2)](/getegid/2.md),  [**getsid**(2)](/getsid/2.md),  [**getlogin**(3)](/getlogin/3.md),  [**getpgrp**(2)](/getpgrp/2.md),  [**ctermid**(3)](/ctermid/3.md),  [**tcgetpgrp**(3)](/tcgetpgrp/3.md),  [**tcgetsid**(3)](/tcgetsid/3.md),  [**getpwuid**(3)](/getpwuid/3.md) and  [**getgroups**(2)](/getgroups/2.md).

- **-P**, **--platform**

  Display platform details.

- **-q**, **--time**

  Display time details. See [**clock\_gettime**(2)](/clock_gettime/2.md),  [**localtime**(3)](/localtime/3.md) and  [**asctime**(3)](/asctime/3.md).

- **-r**, **--ranges**

  Display range of data types. See **limits.h**(P).

- **-s**, **--signals**

  Display signal details. See [**sigaction**(2)](/sigaction/2.md).

- **-S**, **--shared-memory**

  Display shared memory details (not queryable on BSD). See [**shmctl**(2)](/shmctl/2.md).

- **--separator=***str* (\*)

  Specify string *str* as alternate delimiter for text format output (default=': ').

- **-t**, **--tty**

  Display terminal details. On Linux, will also show if any attributes are locked when running as *root*. See [**tcgetattr**(3)](/tcgetattr/3.md) and  [**tty\_ioctl**(4)](/tty_ioctl/4.md) (Linux).

- **-T**, **--threads**

  Display thread details. See [**pthread\_attr\_getstacksize**(3)](/pthread_attr_getstacksize/3.md),  [**pthread\_attr\_getstacksize**(3)](/pthread_attr_getstacksize/3.md) and  [**pthread\_attr\_getguardsize**(3)](/pthread_attr_getguardsize/3.md).

- **-u**, **--stat**

  Display stat details. See [**stat**(2)](/stat/2.md).

- **-U**, **--rusage**

  Display rusage details. See [**getrusage**(2)](/getrusage/2.md).

- **-v**, **--version**

  Display version details.

- **-w**, **--capabilities**

  Display Linux capability details. For FreeBSD file descriptor capabilities, see **--file-descriptors**. See [**prctl**(2)](/prctl/2.md) (Linux), [**libcap**(3)](/libcap/3.md) (Linux).

- **-x**, **--pathconf**

  Display pathconf details. See [**pathconf**(3)](/pathconf/3.md).

- **-y**, **--sysconf**

  Display sysconf details. See [**sysconf**(3)](/sysconf/3.md) and [**posixoptions**(7)](/posixoptions/7.md) (Linux).

- **-Y**, **--memory**

  Display memory details. See [**getpagesize**(2)](/getpagesize/2.md),  [**numa**(3)](/numa/3.md) (Linux) and [**numa**(7)](/numa/7.md) (Linux).

- **-z**, **--timezone**

  Display timezone details. See [**tzset**(3)](/tzset/3.md).

## ENVIRONMENT VARIABLES

The following environment variables may be used as aliases to their command-line counterparts:

- **PROCENV\_CRUMB\_SEPARATOR**

  Alternative to **--crumb-separator**.

- **PROCENV\_EXEC**

  Alternative to **--exec**.

- **PROCENV\_FILE**

  Alternative to **--file**.

- **PROCENV\_FILE\_APPEND**

  Alternative to **--file-append**.

- **PROCENV\_FORMAT**

  Alternative to **--format**.

- **PROCENV\_INDENT**

  Alternative to **--indent**.

- **PROCENV\_INDENT\_CHAR**

  Alternative to **--indent-char**.

- **PROCENV\_SEPARATOR**

  Alternative to **--separator**.

- **PROCENV\_OUTPUT**

  Alternative to **--output**.

## NOTES

- •

  Options are considered in order, so **--output** should precede any other option.

- •

  If no display option is specified, all details are displayed.

- •

  Only one display option may be specified.

- •

  Command-line options take priority over environment variables.

- •

  All values for **--indent-char** are literal except '\\t' which can be used to specify a tab character. The same is true for **--separator-char** and **--crumb-separator** but only if it is the first character specified.

- •

  Specifying a visible indent-char is only (vaguely) meaningful for text output.

- •

  If **--exec** is specified, atleast one non-option argument must also be specified.

- •

  Any long option name may be shortened as long as it remains unique.

- •

  The *crumb* output format is designed for easy parsing: it displays the data in a flattened format with each value on a separate line preceded by all appropriate headings which are separated by the current separator.

- •

  The **--message-queues**, **--semaphores** and  **--shared-memory** options are not available on BSD since although the values are queryable, there is no documented method to do so.

## EXAMPLES

```
 # Show limits
 procenv -l
 # Send compiler information to syslog (note the order of the options).
 procenv --output=syslog --compiler
 # Write compiler details direct to the terminal
 procenv --output=terminal --compiler
 # Run a command ('mycmd --arg1 --foo=bar') without creating a new
 # process, but have procenv run first and log its output to a
 # regular file.
 exec procenv --file=/tmp/procenv.log --exec -- mycmd --arg1 --foo=bar
 # The following kernel command-line snippet will cause procenv to
 # write output to first serial tty device and then execute init(8)
 # in debug mode to allow early boot environment to be examined.
 init=/usr/bin/procenv PROCENV_FILE=/dev/ttyS0 PROCENV_EXEC="/sbin/init --debug"
 # Display all data in JSON format using an indent of 4 spaces
 procenv --format=json --indent=4
 # Display all data in XML format using tabs for indents
 procenv --format=xml --indent-char="\t"
 # Display signal details in XML format
 procenv --format=xml --signals
 # Display resource limits in easily-parseable format
 procenv --format=crumb --limits
 # Produce output suitable for importing into a spreadsheet
 procenv --format=crumb --crumb-separator=',' --separator=',' --limits
 # Produce stylised output
 procenv --format=crumb --crumb-separator=' → ' --separator='='
```

## LIMITATIONS

- •

  Spaces within the value of **PROCENV\_EXEC** are treated as delimiters meaning that any spaces within a string argument for example will result in incorrect behaviour.

- •

  The separator character must be chosen carefully since no check is performed on the data to see if *it itself* contains instances of the separator character.

## AUTHORS

Written by James Hunt \<**jamesodhunt@ubuntu.com**\> and Kees Cook \<**kees@ubuntu.com**\>.

## COPYRIGHT

Copyright © 2012-2016 James Hunt \<**jamesodhunt@ubuntu.com**\> and Kees Cook \<**kees@ubuntu.com**\>.\
 This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## LICENSE

GNU GPL version 3 or later \<http://gnu.org/licenses/gpl.html\>.\
 This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

## SEE ALSO

[**capabilities**(7)](/capabilities/7.md) (Linux),  [**capsicum**(4)](/capsicum/4.md) (BSD),  [**cc**(1)](/cc/1.md), [**credentials**(7)](/credentials/7.md), [**date**(1)](/date/1.md), [**env**(1)](/env/1.md), **exec**(P), [**getconf**(1)](/getconf/1.md), [**groups**(1)](/groups/1.md), [**ifconfig**(8)](/ifconfig/8.md), **ip**(9), [**ipcs**(1)](/ipcs/1.md), [**kill**(1)](/kill/1.md), [**ldd**(1)](/ldd/1.md), [**locale**(1)](/locale/1.md), [**ls**(1)](/ls/1.md), **mount**(1), [**proc**(5)](/proc/5.md), [**ps**(1)](/ps/1.md), [**rights**(4)](/rights/4.md)(BSD), [**sh**(1)](/sh/1.md), [**stat**(1)](/stat/1.md), [**stty**(1)](/stty/1.md), **umask**(P), [**uname**(1)](/uname/1.md)
