locale writes information about the current locale to the standard output. If no options or operands are specified then the
environment for each locale category is summarized. If operands are spcified then information is written about each operand: a
locale category name operand (categories) selects all keywords in that category; other operands name keywords within a category.
Keyword names are unique across all categories, so there is no ambiguity.
category=value operands set the corresponding
locale
category to
value by a call to
setlocale(3). A
value
of
- is interpreted as
NULL, allowing
category to be queried. The
TEST category converts the
value
locale name to a canonical form and lists the converted name on the standard output.
If the --all or --undefined options are specified and no operands are specified then the names of all defined locales
are listed on the standard output. A defined locale name should work as an argument to
setlocale(3). An undefined name is valid but not supported on the
local system. Locale names have the general form language_territory.charset@attribute[,attribute]*
At least one of language or territory is always specified, the other parts are optional. The --abbreviated, --qualified
, --verbose and --local options determine the locale name listing style. The default is --abbreviated. If
multiple styles are specified then the names are listed in columns in this order: abbreviated, qualified, verbose
and local.