Linux tricks, one-liners & shell magic
← Back to all tricks
List all environment variables sorted

Print every environment variable in alphabetical order — handy when debugging missing config or checking what a script will see.

bash
$ printenv | sort # Or just search for a specific one: printenv | grep -i path
envhunter2026-04-19
Delete this trick? This cannot be undone.