Shell and Environment

env

Prints or runs commands with an environment.

env displays environment variables or starts a command with modified environment values.

Syntax
env [NAME=value...] [command]

Arguments explained

  • NAME=value sets variables for the command.
  • -i starts with an empty environment.
  • command is optional.

Common examples

List environment
env

Prints environment variables visible to child processes.

Run with one temporary variable
env DEBUG=1 ./app

Starts ./app with DEBUG set only for that command.

env Command
FieldDetails
Commandenv
CategoryShell and Environment
Primary usePrints or runs commands with an environment.
Syntaxenv [NAME=value...] [command]