Zolved community solution Createarticle_iconnew articleEditarticle_iconedit article

How to set environment variables on Ubuntu.

Here we will learn how to go setting up environment variables on Ubuntu.

Just follow these simple steps to set systemwide environment variables on Ubuntu.

  • Go to Applications > Accessories > Terminal to open the terminal window.
            
  • Enter the following command at the prompt to take the back up of /etc/profile file.

    sudo cp -p /etc/profile /etc/profile_backup



  • To edit the /etc/profile file, enter the following command at the terminal

    gksudo gedit /etc/profile



  • Add the environment variable as shown at the end of file.
    Format for this command is:
    export ENV_VAR_NAME=VALUE


    export VINAYA_HOME=/home/iptouch/vinaya
    In the example above, VINAYA_HOME is the name of the environment variable and /home/iptouch/vinaya is its value.

            
  • Save and close the file.

  • To test it, restart the machine and type the commands as shown.
    cd /home
    cd $VINAYA_HOME 
    ( Remember that this is the
    ENV_VAR_NAME)
    pwd



copyright © 2008, IPTouch, Inc.

 

 

Comments