How do I set environment variables in my shell?

Updated -

In order to set environment variables you have to use the specific command for the shell which you are using. If you wish to figure out which shell you are in you can issue the command echo $SHELL as shown below:

# echo $SHELL

Below is a table and the correct command and syntax for some of the more popular shells.

Shell...

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.