Article Title: Basic knowledge about environment variables. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. View All environment variables: env
2. view a variable value: echo $ variable name
3. Set a new variable: export variable name = variable value
4. Set a variable value if it already exists.
Export classpath = $ classpath:/path/to/program
Note: different variables in unix are separated by colons (:).
5. Use unset to clear Environment Variables
Set can set the value of an environment variable. Clear the unset.
If not specified, the variable is null.
Eg: $ export TEST = "test" // Add a variable
$ Env | grep TEST // This command has output to prove that the variable TEST already exists.
The output result is as follows: TEST = test
$ Unset TEST // Delete
$ Env | grep TEST // This command is not output, proving that the variable TEST does not exist
6. Set the java class path
There are three methods:
1> permanent, implemented by setting the classpath environment variable at the system level.
Reload the profile environment # source/etc/profile
2> temporarily, you can set the classpath environment variable in the Command window or shell.
3> at runtime, the class path must be specified each time the java application and JVM are started.
This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/blueyaya/archive/2005/09/29/491800.aspx