The Linux shell is an application like the others. When launched, a shell application loads automatically a set of startup scripts:
Each variable declared inside these scripts will be available for each command and script launched inside the shell.
Let's take the common case of the “Bourne compatible shells” (sh, bash, ksh, ash). When launched, they loads these scripts:
/etc/profile/home/username/.profileFor example, to add the “$HOME/bin” directory to the PATH variable:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
To execute in the shell your .profile script without logging out/in:
source .profile