System Variable | Meaning | To View Variable Value Type |
---|---|---|
BASH_VERSION | Holds the version of this instance of bash. | echo $BASH_VERSION |
HOSTNAME | The name of the your computer. | echo $HOSTNAME |
CDPATH | The search path for the cd command. | echo $CDPATH |
HISTFILE | The name of the file in which command history is saved. | echo $HISTFILE |
HISTFILESIZE | The maximum number of lines contained in the history file. | echo $HISTFILESIZE |
HISTSIZE | The number of commands to remember in the command history. The default value is 500. | echo $HISTSIZE |
HOME | The home directory of the current user. | echo $HOME |
IFS | The Internal Field Separator that is used for word splitting after expansion and to split lines into words with the read builtin command. The default value is <space><tab><newline>. | echo $IFS |
LANG | Used to determine the locale category for any category not specifically selected with a variable starting with LC_. | echo $LANG |
PATH | The search path for commands. It is a colon-separated list of directories in which the shell looks for commands. | echo $PATH |
PS1 | Your prompt settings. | echo $PS1 |
TMOUT | The default timeout for the read builtin command. Also in an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the command. If not input provided it will logout user. | echo $TMOUT |
TERM | Your login terminal type. | echo $TERM export TERM=vt100 |
SHELL | Set path to login shell. | echo $SHELL |
DISPLAY | Set X display name | echo $DISPLAY export DISPLAY=:0.1 |
EDITOR | Set name of default text editor. | export EDITOR=/usr/bin/vim |
You can use the env / set command too:
envenv | moresetset | more
Sample outputs:
HOME=/home/vivekvivek@nas01:~$ envTERM=xterm-256colorSHELL=/bin/bashXDG_SESSION_COOKIE=9ee90112ba2cb349f07bfe2f00002e46-1381581541.324726-906214463SSH_CLIENT=192.168.1.6 60190 22SSH_TTY=/dev/pts/1USER=vivekMAIL=/var/mail/vivekPATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/gamesPWD=/home/vivekLANG=en_INSHLVL=1HOME=/home/vivekLANGUAGE=en_IN:enLOGNAME=vivekSSH_CONNECTION=192.168.1.6 60190 192.168.1.10 22_=/usr/bin/env
联系客服