Major Built-in Variables in Linux

echo $HOME : Returns user home directory
[sreevalsan256@instance-1 ~]$ echo $HOME
/home/sreevalsan256
echo $PWD : Returns Current directory
[sreevalsan256@instance-1 test]$ echo $PWD
/home/sreevalsan256/test
echo $MACHTYPE : Returns machine type
[sreevalsan256@instance-1 test]$ echo $MACHTYPE
x86_64-redhat-linux-gnu
echo $HOSTNAME : Returns system name
[sreevalsan256@instance-1 test]$ echo $HOSTNAME
instance-1
echo $BASH_VERSION : Returns bash verison
[sreevalsan256@instance-1 test]$ echo $BASH_VERSION
4.1.2(2)-release
echo $SECONDS : Returns the number of seconds the bash session has run.
When we use this on scripts, it will count the seconds when the script started.
[sreevalsan256@instance-1 test]$ echo $SECONDS
733
echo $0 : Returns the name of the script

Leave a comment