Networking / Beginners

Environment variables

The shell makes several environment variables available to commands. You can use an environment variable anywhere in a command by typing $ (dollar sign) followed by the environment variable name. For example, this command

$ echo This is $HOSTNAME running on an $HOSTTYPE

displays a line such as

This is LSERVER running on an i386

Table below lists some of the more useful environment variables that are available to you and your commands.

Environment Variables

VariableDescription
HOMEThe current user's home directory.
HOSTNAMEThe computer's host name.
HOSTTYPEThe host computer type.
OSTYPEThe operating system.
PATHThe search order for executable programs.
PROMPT_COMMANDThe command used to generate the prompt.
PWDThe present working directory.
SHELLThe shell being used.
USERNAMEThe current username.
[Previous] [Contents] [Next]