env
Quick Reference
Command Name:
env
Category:
system management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Environment inspection
Display all environment variables to troubleshoot configuration issues
- 2
Isolated command execution
Run commands with a clean or customized environment
- 3
Temporary variable modification
Change environment variables for a single command without affecting the shell
- 4
Script portability
Ensure consistent environment settings across different systems
Syntax
env [option]... [name=value]... [command [args]...]
Options
Option | Description |
---|---|
-i, --ignore-environment |
Start with an empty environment |
-0, --null |
End each output line with NUL, not newline |
-u, --unset=NAME |
Remove variable NAME from the environment |
-C, --chdir=DIR |
Change working directory to DIR before running command |
-S, --split-string=S |
Process and split S into separate arguments |
--debug |
Print debugging information |
-v, --version |
Print version information |
-h, --help |
Display help information |
Examples
How to Use These Examples
The examples below show common ways to use the env
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.