This tutorial is still about creating environment variables, just like my last tutorial. But now I create environment variable in Linux, not Windows.
To create or edit environment variable in linux is very easy. You may create or edit environment variable from terminal.
The syntax is: export VAR_NAME=var_content
For example:
export JAVA_HOME=/usr/lib/jvm/sun-java6
Yes, very easy right? If you want to append content to an existing variable, you can’t use command above. Command above will create a new variable, not append it. To append content, you may use command below.
The syntax is: export VAR_NAME=$VAR_NAME:var_content
For example:
export PATH=$PATH:/usr/lib/jvm/sun-java6/bin
or, if you have created JAVA_HOME variable, you may use command below:
export PATH=$PATH:$JAVA_HOME/bin
Easy right?
Note:
To define a variable, you don’t need ‘$‘ character. But when you use it (for example when you append variable content), don’t forget ‘$‘ character.
Related posts:
- How to Create Environment Variables in Windows
- How To Install Java in Linux Ubuntu
- Checking Disk Capacity in Linux
- Send Message Over Linux Console
Tags: Environment Variables, Linux








Leave a Reply