locale(1) — Commands
NAME
locale − Displays information about locales
SYNOPSIS
locale [-a | -m]
locale [-c] [-k] name ...
The locale command writes information about the current locale or all public locales.
FLAGS
-aWrites information about all available public locales.
-cWrites the names of the specified locale categories.
-kWrites the names and values of specified locale keywords.
-mWrites the names of all available character map files.
DESCRIPTION
The locale command without any flags or arguments writes to standard output the names and values of all the current locale environment variables, such as LANG and LC_COLLATE.
The locale command with -a or -m flags displays information about available locales and character maps on your system. The name argument specifies a locale category or locale keyword.
•If the -a flag is specified, locale writes the names of all available public locales. These are locales that are available to any application.
•If the -m flag is specified, locale writes a list of the names of all available character-mapping files. These values are suitable variable values for the -f flag with the localedef command.
The locale command with the name argument displays information about locale categories and keywords in the current locale. For example, the command could display information about the decimal_point keyword in the LC_NUMERIC category or information about all keywords in the LC_NUMERIC category. The name parameter can be either a locale category or a keyword from a category.
The -c and -k flags determine the information displayed by the locale command about the locale keywords:
Flags SetInformation Written to Standard Output
NoneValue of keyword specified by name parameter or values of all keywords in the category specified by name parameter.
-cName of category containing the keyword specified by the name parameter or the name of the category specified by the name parameter, followed by values of locale keywords.
-kNames and values of locale keywords.
-ckName of category, followed by names and values of locale keywords.
Following are the locale categories and the associated locale keywords that can be used in the name parameter. Note that there are no associated locale keywords for the LC_COLLATE and LC_CTYPE categories:
Locale CategoryLocale Keywords
LC_COLLATENone.
LC_CTYPENone.
CHARMAPcharmap
code_set_name
mb_cur_max
mb_cur_min
LC_MESSAGESyesexpr
noexpr
yesstr
nostr
LC_MONETARYint_curr_symbol
currency_symbol
mon_decimal_point
mon_grouping
mon_thousands_sep
positive_sign
negative_sign
int_frac_digits
frac_digits
p_cs_precedes
p_sep_by_space
n_cs_precedes
n_sep_by_space
p_sign_posn
n_sign_posn
debit_sign
credit_sign
left_parenthesis
right_parenthesis
LC_NUMERICdecimal_point
thousands_sep
grouping
LC_TIMEabday
abmon
alt_digits
am_pm
d_fmt
d_t_fmt
day
era
era_d_fmt
era_d_t_fmt
era_t_fmt
era_year
mon
t_fmt
t_fmt_ampm
If multiple name arguments are specified, the locale command processes them in order.
EXAMPLES
1.Assume that the LANG environment variable is set to fr_FR.ISO8859-1 and the LC_MONETARY environment variable to fr_CA.ISO8859-1. The following example shows results when you enter the locale command without flags:
% locale
LANG=fr_FR.ISO8859-1
LC_COLLATE="fr_FR.ISO8859-1"
LC_CTYPE="fr_FR.ISO8859-1"
LC_MONETARY="fr_CA.ISO8859-1"
LC_NUMERIC="fr_FR.ISO8859-1"
LC_TIME="fr_FR.ISO8859-1"
LC_MESSAGES="fr_FR.ISO8859-1"
LC_ALL=
The LC_ALL variable, if set, overrides the values of other variables. For example, if LC_ALL is set to en_US.ISO8859-1, the setting implies LC_COLLATE=en_US.ISO8859-1, even if the LC_COLLATE environment variable is set to another locale.
2.In the following example, the locale command retrieves the value of the decimal_point delimiter for the current locale:
% locale -ck decimal_point
LC_NUMERIC
decimal_point="."
RELATED INFORMATION
Commands: localedef(1).
Functions: setlocale(3).
Files: locale(4).