DELAPARRA
Index
Color
NL
Category: CLI commands

env

Explained by Updated

What is env?

env: Environment — List all environment variables, or run a command with a specific environment. env shows the environment variables of the current shell, or runs a command with a modified environment. env | grep APP lists variables starting with APP; env APP_ENV=testing php artisan test runs the tests with a different value without changing your shell.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about env

How is env used in practice?

Environment variables are how most applications receive configuration: database credentials, API keys and feature switches. When an application behaves differently than expected, checking what it actually sees is a quick first step.

What should you keep in mind with env?

You often see #!/usr/bin/env python3 at the top of scripts. It finds the interpreter on the user's PATH, which makes the script work across systems where Python lives in different places. Be careful when printing the environment on shared screens or in CI logs, since it may contain secrets.

At a glance

CategoryCLI commands
Explained by
Updated

More CLI commands terms

All terms starting with E

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.