locale - get locale-specific information
locale [ -a| -m]
locale [-ck] name...
The locale utility writes information about the current locale
environment to the standard output. When locale is invoked without any
arguments, it summarizes the current locale environment for each locale
category as determined by the settings of the environment variables
defined LANG, LC_ALL, LC_CTYPE, LC_COLLATE, LC_MONETARY, LC_NUMERIC,
LC_TIME, and LC_MESSAGES.
When invoked with operands, it writes values that have been assigned to
the keywords in the locale categories, as follows:
-Specifying a keyword name selects the named keyword and the category
containing that keyword.
-Specifying a category name selects the named category and all keywords
in that category.
The following options are supported:
-a Write information about all available locales.
-c Write the names of selected locale categories; see STDOUT. The -c
option increases readability when more than one category is selected
(for example, via more than one keyword name or via a category
name). It is valid both with and without the -k option.
-k Write the names and values of selected keywords.
-m Write names of available charmaps.
name The name of a locale category, the name of a keyword in a locale
category, or the reserved name charmap. The specified category or
keyword is selected for output.
In the following examples, the assumption is that locale environment
variables are set as follows:
> LANG =en_US LC_COLLATE =fr
would result in the following output:
> LC_ALL =en_US locale -ck decimal_point
The following command shows an application of locale to determine whether
a user-supplied response is affirmative:
if printf "%s0 "$response" | grep -Eq "$( local yesstr )"
affirmative processing goes here
non-affirmative processing goes here
system supported locales
PPPPaaaaggggeeee 2222 [ Back ]