Thursday, October 18, 2012

Thirteenth session of Some of basic UNIX commands that are useful very frequently

Today we will discuss about some more commands that are used very frequently in UNIX/LINUX bases operating systems.

If one want to print value of 'PATH' system variable, then using below command we can achieve it.

echo $PATH$

Above command will displays the value of system variable 'PATH'. Its similar to the below command that we use in windows based operating systems.

echo %PATH%

Below is sample output:

$ echo $PATH$
/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)....

Like wise, if one want to display value of any system variable or user defined system variable like JAVA_HOME, CLASSPATH and CATALINA_HOME etc.., then he/she can achieve it as specified above.

To confirm what you are thinking in your mind to execute the same, below is one more similar example for displaying value of 'JAVA_HOME' ( one can also say that Java installed directory):

echo $JAVA_HOME$

Hmmmmmmmm...... yes, your thought is correct. Its similar to echo %JAVA_HOME% that we use in windows based operating systems to know Java installed directory.

If the variable that you want to know the value is not set in your system, then you will get result as an empty string ''. Below is sample illustration:

$ echo $JAVA_HOME$

Please feel free to try this. If you already got a chance to work with, then share your thoughts....

Can guess your next thought??????? to modify corresponding system variable (PATH, JAVA_HOME etc..).. how it can be achievable??? Don't worry, we can discuss about this in next post.. will keep posting...

No comments: