Using export and not using export - environment variables
and then, regardless of what directory you are in, you can issue
to pop over quickly to the directory containing the source code for that way-cool spew program you're developing. (The cd command means "change directory.")
A variable assignment like this will work just fine, but its scope (visibility) is limited to the current shell. If you launch a program or enter another shell, that child task will not know about your environment variables unless you export them first.
Unless you know for sure that an environment variable will have meaning only in the current shell, it's a good idea to always useexport when creating variables to ensure they will be global in scope--for example,
export PS1="\u \$ "
And be sure to add these commands to your .profile file so you won't have to retype them eac h time you log in.