List environment variables in Shell

access_time 2 years ago visibility16 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

env
echo ${USER}
echo ${SHELL}
info Last modified by Raymond 2 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 or Twitter.

Want to publish your article on Kontext?

Learn more

More from Kontext

visibility 55
thumb_up 0
access_time 2 years ago

The following code snippet shows how to list and kill Hadoop jobs including (MapReduce and YARN jobs).

visibility 37
thumb_up 0
access_time 2 years ago

Hadoop provides a number of CLIs. hadoop job command can be used to retrieve running job list.

You can also use YARN resource manager UI to view the jobs too.

visibility 292
thumb_up 0
access_time 2 years ago

Hadoop provides a number of CLIs that can be used to perform many tasks/activities. This code snippet shows you how to check file/folder size in HDFS.