Writes information to standard output about either the current locale or all public locales.
locale [ -O 64 ][ -a | -m ] | [ [ -c ] [ -k ] Name ... ]
The locale command writes information to standard output about either the current locale or all public locales. A public locale is a locale available to any application.
To write the name and value of each current locale category, do not specify any flags or variables. To write the names of all available public locales, specify the -a flag. To write a list of the names of all available character-mapping (charmap) files, specify the -m flag. These charmap filenames are suitable values for the -f flag specified with the localedef command.
To write information about specified locale categories and keywords in the current locale, specify the Name parameter. The Name parameter can be one of the following:
You can specify more than one Name parameter with the locale command.
If you specify the locale command with a locale category name and no flags, the locale command writes the values of all keywords in the locale category specified by the Name parameter. If you specify the locale command with a locale keyword and no flags, the locale command writes the value of the keyword specified by the Name parameter.
If the Name parameter is a locale category name or keyword, the -c and -k flags can determine the information displayed by the locale command.
This command returns the following
exit values:
0 | All the requested information was found and output successfully. |
>0 | An error occurred. |
locale
If locale_x and locale_y are valid locales on the system, as determined with locale -a, and if the locale environment variables are set as follows:
LANG=locale_x LC_COLLATE=locale_y
The locale command produces the following output:
LANG=locale_x LC_CTYPE="locale_x" LC_COLLATE=locale_y LC_TIME="locale_x" LC_NUMERIC="locale_x" LC_MONETARY="locale_x" LC_MESSAGES="locale_x" LC_ALL=
Note: When setting the locale variables, some values imply values for other locale variables. For example, if the LC_ALL locale variable is set to the En_US locale, all locale environment variables are set to the En_US locale. In addition, implicit values are enclosed in double quotes ("). Explicitly set values are not enclosed in double quotes ("). See "Understanding Locale Environment Variables" in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices for more information.
locale charmap
If the LC_ALL locale variable is set to the C locale, the locale command produces the following output:
ISO8859-1
locale -ck decimal_point
If the LC_ALL locale variable is set to the C locale, the locale command produces the following output:
LC_NUMERIC decimal_point="."
The localedef command.
Character Set Description (charmap) Source File Format and Locale Definition Source File Format in AIX 5L Version 5.1 Files Reference.
For specific information about the locale definition source file format, categories, and their locale variables, see the LC_COLLATE category, LC_CTYPE category, LC_MESSAGES category, LC_MONETARY category, LC_NUMERIC category, and LC_TIME category in AIX 5L Version 5.1 Files Reference.
National Language Support Overview for System Management, Locale Overview for System Management, and Understanding Locale Environment Variables in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices.