List environment variables alphabetically
Build a paste-ready command, then review its compatibility and effects before running it.
read-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsenvenv must be installed and available on PATH.
Version supportenv Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsHOME=/home/alexRepresentative successful output; values vary with the selected target and system state.
Known errorsenv: command not foundenv is missing or is not available on PATH.
Verifyenv | sortThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01envCommandRuns the env stage of this one-liner.
02|PipelinePasses the output on the left to the command on the right.
03sortCommandRuns the sort stage of this one-liner.
Example output
HOME=/home/alex
LANG=en_US.UTF-8
PATH=/usr/local/bin:/usr/bin:/bin
SHELL=/bin/bash
USER=alex
Illustrative output — exact values vary by system and data.
Official sources