Quickly list and control the process environment to debug scripts and run programs with tailored variables. 16.11.2025 | reading time: 2 min Want to know which environment variables shape a program's behavior? Use env to list the current environment and to run commands with modified variables so you can reproduce or fix issues quickly. Hands-on example Try this sequence in a shell to set a variable, list it, and run a one-off command with a temporary variable: ```bash $ export APP_ENV=production $ env | grep APP_ENV APP_ENV=production $ env APP_MODE=debug python3 -c "import os; print(os.getenv('APP_MODE'))" debug ``` Practical tricks Run `env` by itself to dump all variables; use `env -i` to start with an empty environment when you need a clean state; use `env VAR=value command` to set variables for a single invocation and `env -u VAR` to unset a variable temporarily. Where env fits When debugging PATH issues or service startups, pair `env` with other sources: `printenv` for simple queries, the shell builtin `set` to see shell variables and functions, and `/proc/<pid>/environ` to inspect another process's environment when permitted. Final perspective Mastering env makes environment-related problems visible and solvable; keep practicing with scripts and services, and consider formal certification such as CompTIA Linux+ or LPIC-1 to deepen knowledge, with bitsandbytes.academy offering intensive exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting troubleshooting