Environment Variables and Shell Rc File

10,902

This depends on which shell your using. I'm going to assume you'll be using bash. To set an environment variable:

VARNAME=new_value_of_variable
export VARNAME

If you want the changes to be persistent you should add these commands to the file $HOME/.bash_profile

For bash the rc file is $HOME/.bashrc

You can find out which shell you are using with the command echo $SHELL. If you are using something other than bash I can update this for whatever shell you're using

Share:
10,902

Related videos on Youtube

Dru
Author by

Dru

Updated on September 18, 2022

Comments

  • Dru
    Dru over 1 year

    Possible Duplicate:
    What are PATH and other environment variables, and how can I set or use them?

    I am trying to automatically establish a connection with Amazon s3 using keys. This documentation provides instructions but I am unsure of how to set environment variables and where my shell rc file is located.

    Using linux, how do I set environment variables and what/where is a shell rc file?