One of the most commonly used but not well understood by everyone is the
export shell command. The way most of the users know about it is through installation instructions of many softwares which require environment variables to be set.
export TERM=xterm means that the environment variable
TERM is available to any other program, or more suitably, any process that is started from that shell after the variable is set. So, if I start another script from my shell, then I will get the value xterm when I check the variable
TERM. If you set it in your
.bashrc then it is available all processes that are started from that shell.
If you don’t want to make the variable to these processes, then you can use
TERM=xterm. That will limit its scope to that specific shell.
export can cause problems. Apart from the necessity of exporting some variables for some programs to work properly, exporting some others might have side-effects. For example, exporting the CDPATH variable might cause some scripts to unpredicted behaviour from programs which assume that the directory base has not been reset. Export only those variables which will be needed by others, and leave the others within your shell.