Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

printenv

Print environment variable values

Syntax

printenv [OPTION]... [VARIABLE]...

Common Options

-0Null-delimited output
VARIABLEShow only specified variable

Common Examples

printenv

Show all environment variables

printenv PATH

Show PATH variable

printenv HOME USER SHELL

Show multiple variables

printenv | grep JAVA

Search JAVA variables

printenv -0 | xargs -0 -n1

Show vars one per line

if printenv CI > /dev/null; then echo "CI"; fi

Check if variable exists

Related Commands

Related Tools

More Code & Dev Tools