languageEnglish

List environment variables in Shell

visibility 29 comment 0 access_time 3 years ago

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

env
echo ${USER}
echo ${SHELL}
info Last modified by Raymond 3 years ago copyright This page is subject to Site terms.

Subscribe newsletter

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext

visibility 9
thumb_up 0
access_time 2 months ago
visibility 55
thumb_up 0
access_time 2 months ago
visibility 136
thumb_up 0
access_time 3 years ago