Some Variables Of Shell
In order to process our data or information, all data must be kept in our computers RAM memory. The RAM memory is divided into small locations and each location have a unique number called memory location or address which is used in computer to hold our data. Programmers can give a unique name to this memory location or address called memory variables or variables.
There are two types of variables in Linux Operating System:
- System variable – This type of variables are created and maintained by Linux in itself. These type of variables are defined in CAPITAL LETTERS in Linux OS.
- User defined variable – This type of variables are created and maintained by users. This type of variable is defined in lower letters by users in Linux OS.
We can see all system variables in Linux OS by giving command like $ set, some of the important System variables are given below:
System Variable
|
Meaning
|
$BASH | Tells the name of Shell |
$BASH_VERSION | Tells the version name |
$HOME | Tells our home directory |
$LOGNAME | Tells our logging name |
$OSTYPE | Tells our Os type |
$PATH | Tells our path settings |
$PWD | Tells our current working directory |
$SHELL | Tells the our shell name |
$USERNAME | Tells the user name who is currently logged to this PC |
NOTE:- To print any of the above variables contains you can write as follows:
- $ echo $USERNAME
- $ echo $HOME
- $ echo PWD
- $ echo PATH
Leave a Comment