NAME
locale - get locale-specific information SYNOPSIS locale [option]
locale [option] -a
locale [option] -m locale [option] name... DESCRIPTION The locale command displays information about the current locale, or all locales, on standard output. When invoked without arguments, locale displays the current locale set‐ tings for each locale category (see locale(5)), based on the settings of the environment variables that control the locale (see locale(7)). Values for variables set in the environment are printed without double quotes, implied values are printed with double quotes.
If either the -a or the -m option (or one of their long-format equiva‐ lents) is specified, the behavior is as follows:
-a, all-locales
Display a list of all available locales. The -v option causes the LCIDENTIFICATION metadata about each locale to be included in the output.
-m, charmaps Display the available charmaps (character set description files). To display the current character set for the locale,
use locale -c charmap. The locale command can also be provided with one or more arguments,
which are the names of locale keywords (for example, datefmt, ctype-
class-names, yesexpr, or decimalpoint) or locale categories (for exam‐ ple, LCCTYPE or LCTIME). For each argument, the following is dis‐ played: * For a locale keyword, the value of that keyword to be displayed. * For a locale category, the values of all keywords in that category are displayed. When arguments are supplied, the following options are meaningful:
-c, category-name For a category name argument, write the name of the locale cate‐ gory on a separate line preceding the list of keyword values for that category. For a keyword name argument, write the name of the locale cate‐ gory for this keyword on a separate line preceding the keyword value. This option improves readability when multiple name arguments
are specified. It can be combined with the -k option.
-k, keyword-name For each keyword whose value is being displayed, include also the name of that keyword, so that the output has the format: keyword="value" The locale command also knows about the following options:
-v, verbose
Display additional information for some command-line option and argument combinations.
-?, help
Display a summary of command-line options and arguments and exit. usage Display a short usage message and exit.
-V, version Display the program version and exit. FILES
/usr/lib/locale/locale-archive Usual default locale archive location. /usr/share/i18n/locales Usual default path for locale definition files. CONFORMING TO
POSIX.1-2001, POSIX.1-2008. EXAMPLE
$ locale
LANG=enUS.UTF-8
LCCTYPE="enUS.UTF-8"
LCNUMERIC="enUS.UTF-8"
LCTIME="enUS.UTF-8"
LCCOLLATE="enUS.UTF-8"
LCMONETARY="enUS.UTF-8"
LCMESSAGES="enUS.UTF-8"
LCPAPER="enUS.UTF-8"
LCNAME="enUS.UTF-8"
LCADDRESS="enUS.UTF-8"
LCTELEPHONE="enUS.UTF-8"
LCMEASUREMENT="enUS.UTF-8"
LCIDENTIFICATION="enUS.UTF-8" LCALL=
$ locale datefmt
%a %b %e %H:%M:%S %Z %Y
$ locale -k datefmt
datefmt="%a %b %e %H:%M:%S %Z %Y"
$ locale -ck datefmt LCTIME
datefmt="%a %b %e %H:%M:%S %Z %Y"
$ locale LCTELEPHONE
+%c (%a) %l
(%a) %l 11 1
UTF-8
$ locale -k LCTELEPHONE
telintfmt="+%c (%a) %l"
teldomfmt="(%a) %l" intselect="11" intprefix="1"
telephone-codeset="UTF-8" The following example compiles a custom locale from the ./wrk directory
with the localedef(1) utility under the $HOME/.locale directory, then tests the result with the date(1) command, and then sets the environ‐ ment variables LOCPATH and LANG in the shell profile file so that the custom locale will be used in the subsequent user sessions:
$ mkdir -p $HOME/.locale
$ I18NPATH=./wrk/ localedef -f UTF-8 -i fiSE $HOME/.locale/fiSE.UTF-8
$ LOCPATH=$HOME/.locale LCALL=fiSE.UTF-8 date
$ echo "export LOCPATH=\$HOME/.locale" >> $HOME/.bashrc
$ echo "export LANG=fiSE.UTF-8" >> $HOME/.bashrc SEE ALSO localedef(1), charmap(5), locale(5), locale(7)
Linux 2016-03-15 LOCALE(1)