What are environment variables, and why is `PATH` important for command-line tools?
Answer
Environment variables are named values inherited by processes and commonly used for configuration such as endpoints, credentials references, modes and tool locations. `PATH` is a list of directories the shell searches when a command is invoked without a full path. A tool can be installed correctly yet appear unavailable if its directory is absent from PATH or the shell has stale environment state.
Strong answer includes
- environment variables are process-visible configuration
- PATH controls executable lookup
- understands shell/session inheritance and stale state
Practical example
If `k6` works in one terminal but not another, compare PATH and command resolution before reinstalling it. On PowerShell use `$env:PATH` and `Get-Command k6`; on Linux use `echo "$PATH"` and `command -v k6`.