List environment variables in Shell

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

Want to publish your article on Kontext?

Learn more

Kontext Column

Created for everyone to publish data, programming and cloud related articles.
Follow three steps to create your columns.


Learn more arrow_forward

More from Kontext

local_offer hadoop local_offer shell

visibility 29
thumb_up 0
access_time 11 months 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.

local_offer hadoop local_offer shell

visibility 31
thumb_up 0
access_time 11 months ago

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

local_offer hadoop local_offer shell

visibility 97
thumb_up 0
access_time 11 months 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.

About column

Code snippets for various programming languages/frameworks.

rss_feed Subscribe RSS