Kolam Ayer MakersLinux Foundations

env

Use

env
env | grep '^PATH='

What It Does

env prints environment variables available to a process.

An environment variable is a name-value string passed from a parent process to a child process. Scripts, cron jobs, and systemd services may not receive the same environment as your interactive shell.

Practice

Look for PATH, HOME, and USER.

printf '%s\n' "$HOME"
printf '%s\n' "$USER"
printf '%s\n' "$PATH"
command -v python3

PATH is the list of directories the shell searches when you type a command name.

Expected Output

Watch Out

Environment values can contain sensitive data on other systems. Do not paste them blindly.

Common Failures

Docs Pointers