CLI

Resources

PyPI

Upload to [pypi] or [testpypi].

Environment

  • Get all environment variables with printenv.
  • Use env display all exported environment variables or run a program in a modified environment.
  • Use set to list the name and value of each shell variable.

Commonly used linux variables

We use the printf command/echo command to display values of the shell varible in Linux.

System Variable Meaning To view variable value type
BASHVERSION Holds the version of this instance of bash. echo $BASHVERSION
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 logou 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