For environment variables, when you don’t use them often, it’s not always easy to remember the commands.

To display your PATH:

1
echo $PATH

To display all environment variables:

1
env

To add something to your PATH:

1
PATH=$PATH:/path/to/add

To add a new environment variable:

1
2
MYVAR=/toto
export $MYVAR

Check with the env command and it works! :-)

Last updated 21 Feb 2007, 15:03 +0200. history