access_time 3 years ago languageEnglish

List environment variables in Shell

visibility 23 comment 0

Environment variables are commonly used in many frameworks or programs.

In bash, to list environment variables, you can use env command. 

To list a certain environment variable, you can use ${EnvironmentVariableName}.

Code snippet

echo ${USER}
echo ${SHELL}
info Last modified by Raymond 3 years ago copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn.

Want to contribute on Kontext to help others?

Learn more

More from Kontext

visibility 54
thumb_up 0
access_time 2 years ago
visibility 1347
thumb_up 0
access_time 10 months ago
visibility 597
thumb_up 0
access_time 2 years ago