Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




25.4.2 Standard Environment Variables

These environment variables have standard meanings. This doesn't mean that they are always present in the environment; but if these variables are present, they have these meanings. You shouldn't try to use these environment variable names for some other purpose.

This is a string representing the user's home directory, or initial default working directory.

The user can set HOME to any value. If you need to make sure to obtain the proper home directory for a particular user, you should not use HOME; instead, look up the user's name in the user database (see User Database).

For most purposes, it is better to use HOME, precisely because this lets the user specify the value.

This is the name that the user used to log in. Since the value in the environment can be tweaked arbitrarily, this is not a reliable way to identify the user who is running a program; a function like getlogin (see Who Logged In) is better for that purpose.

For most purposes, it is better to use LOGNAME, precisely because this lets the user specify the value.

A path is a sequence of directory names which is used for searching for a file. The variable PATH holds a path used for searching for programs to be run.

The execlp and execvp functions (see Executing a File) use this environment variable, as do many shells and other utilities which are implemented in terms of those functions.

The syntax of a path is a sequence of directory names separated by colons. An empty string instead of a directory name stands for the current directory (see Working Directory).

A typical value for this environment variable might be a string like:


This means that if the user tries to execute a program named foo, the system will look for files named foo, /bin/foo, /etc/foo, and so on. The first of these files that exists is the one that is executed.

This specifies the kind of terminal that is receiving program output. Some programs can make use of this information to take advantage of special escape sequences or terminal modes supported by particular kinds of terminals. Many programs which use the termcap library (see Find) use the TERM environment variable, for example.
This specifies the time zone. See TZ Variable, for information about the format of this string and how it is used.
This specifies the default locale to use for attribute categories where neither LC_ALL nor the specific environment variable for that category is set. See Locales, for more information about locales.
If this environment variable is set it overrides the selection for all the locales done using the other LC_* environment variables. The value of the other LC_* environment variables is simply ignored in this case.
This specifies what locale to use for string sorting.
This specifies what locale to use for character sets and character classification.
This specifies what locale to use for printing messages and to parse responses.
This specifies what locale to use for formatting monetary values.
This specifies what locale to use for formatting numbers.
This specifies what locale to use for formatting date/time values.
This specifies the directories in which the catopen function looks for message translation catalogs.
If this environment variable is defined, it suppresses the usual reordering of command line arguments by getopt and argp_parse. See Argument Syntax.

  Published under the terms of the GNU General Public License Design by Interspire