Sponsored · Amazon offerTry Amazon Prime freeFast free shipping, Prime Video and more.Start free trial
SponsoredShop Amazon for EnvBrowse products on Amazon.Search Amazon
SponsoredAmazon Best Sellers in Home & KitchenUpdated hourly by Amazon.Shop best sellers
Sponsored · Popular on AmazonElectronicsPet SuppliesTools & Home ImprovementBooks
As an Amazon Associate I earn from qualifying purchases.

Topic summary

Env

Env

env is a shellcommand that either reports environment variables or runs a command in a subprocess with modified environment variables. The command is provided in a Unix-like system.

By default, a subprocess inherits the environment variables of the parent process. env supports adding, modifying and removing the copied variables. env can also be used to launch the correct interpreter. In this usage, the environment is typically not changed. The command does not modify environment variables in the process in which it runs. Mechanisms for doing so include the export command and assigning a name to a value like NAME=value.

The GNUcoreutils version was written by Richard Mlynarik, David MacKenzie, and Assaf Gordon. It first appeared in 4.4BSD, and is a part of POSIX.1 (with the -i option only). This version has been extended to handle signals and the current directory.

FreeBSD's version supports a custom search path. Extensions found in both versions include -u, for unsetting variables, and -S, for splitting arguments (mainly in shebang).