locale - Get locale specific information

Synopsis

locale [ -a ]

locale [ -ck ] name ...

Description

The locale utility displays information about the current locale environment to standard output.

In the first synopsis form, locale writes the names and values of locale environment variables. When the -a option is specified, locale writes the names of all of the available locales on the system.

In the second synopsis form, locale writes detailed information about the locale category or keyword specified by name.

Options

-a
Write information about all available locales.
-c
Display the names of the locale categories.
-k
Display the names of the locale keywords.

Operands

The name operand can be one of the following locale categories or keywords:
  • For category LC_CTYPE the keywords include alnum, alpha, blank, cntrl, digit, graph, lower, print, punct, space, upper, xdigit, and codeset.
  • For category LC_MESSAGES the keywords include yesexpr, noexpr, yesstr, and nostr.
  • For category LC_MONETARY the keywords include int_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, and crncystr.
  • For category LC_NUMERIC the keywords include decimal_point, thousands_sep, grouping, and radixchar.
  • For category LC_TIME the keywords include abday, abday_1, abday_2, abday_3, abday_4, abday_5, abday_6, abday_7, day, day_1, day_2, day_3, day_4, day_5, day_6, day_7, abmon, ab_mon1, abmon_2, abmon_3, abmon_4, abmon_5, abmon_6, abmon_7, abmon_8, abmon_9, abmon_10, abmon_11, abmon_12, mon, mon_1 mon_2 mon_3 mon_4 mon_5 mon_6 mon_7 mon_8 mon_9 mon_10 mon_11 mon_12, d_t_fmt, d_fmt, t_fmt, am_pm, am_str, pm_str, era, era_d_fmt, era_year, t_fmt_ampm, era_t_fmt, era_d_t_fmt, alt_digits.

Exit status

  • 0 when successful
  • >0 when unsuccessful

Examples

  1. Display the current values of the locale environment variables.
    locale
  2. Display the list of available locales on the system.
    locale -a