See which environment variables your shell exports and how they influence processes. 16.11.2025 | reading time: 2 min Ever wondered which variables shape the behavior of your shell and the processes it starts? Run a few simple commands to inspect what the shell exports and inherit those values into child processes. Quick Live Example Open a terminal and run the command shown below to list the current environment; the example includes sample output so you know what to expect. ```bash # show all environment variables env # sample output: PATH=/usr/local/bin:/usr/bin:/bin HOME=/home/alex LANG=C.UTF-8 SHELL=/bin/bash ``` Common Tasks and Tricks Print a single variable with `printenv HOME` or `printenv LANG`, temporarily set a variable for one command like `FOO=bar command`, and make a variable persistent in the current shell with `export VAR=value`; use `declare -x` in bash to list exported variables and `set` to inspect all shell variables and functions. Where Variables Live and How They Flow System and user variables come from files such as `/etc/environment`, `/etc/profile`, and shell startup files like `~/.bashrc`; remember that processes inherit a flat list of name=value pairs and you can examine a running process environment via `/proc/<pid>/environ` by converting NULs to newlines, for example with `tr '\0' '\n' < /proc/1/environ`. Practical Uses Use environment inspection to troubleshoot PATH issues, confirm service runtime settings, debug CI jobs, or ensure secrets are not unintentionally exported; inspect and modify variables before running scripts to get reproducible results. Next Steps Now that you can list and manipulate environment variables, practise setting, exporting, and scoping them in scripts; deepen your Linux skills and consider certification preparation such as CompTIA Linux+ or LPIC-1 with intensive exam training at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting processes troubleshooting