locale(1)

๐Ÿ’– NAME ๐Ÿ’–

locale โ€” get locale-specific information, bestie โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

locale [option]

locale [option] -a

locale [option] -m

locale [option] name ...

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so basically, the locale command spills the tea about your current locale โ€” or about all the locales โ€” and dumps it all to standard output. ๐Ÿ’…

When you run it with no arguments at all? It shows you the current locale settings for every single locale category (peep locale(5) for that whole situation), and it figures those out from the environment variables that control the locale (that's locale(7), iykyk). Here's the little detail that trips people up: values that were actually set in the environment get printed with no double quotes, but implied values get printed with double quotes. So the quotes are lowkey telling you where the value came from. ๐Ÿ‘‘

If you throw in either the -a or the -m option (or one of their long-format equivalents), the behavior switches up like this:

  • --all-locales, -a โ€” shows you a list of every available locale. And if you also pass -v, the LC_IDENTIFICATION metadata for each locale gets included in the output. โœจ
  • --charmaps, -m โ€” shows you the available charmaps (those are the character set description files). Wanna see the current character set for the locale instead? Use locale -c charmap.

You can also hand locale one or more arguments, and those arguments are the names of locale keywords (think date_fmt, ctype-class-names, yesexpr, or decimal_point) or locale categories (think LC_CTYPE or LC_TIME). For each argument you pass, here's what goes down:

  • For a locale keyword, the value of that keyword gets displayed.
  • For a locale category, the values of all the keywords in that category get displayed.

When you supply arguments, these options suddenly become meaningful:

  • --category-name, -c โ€” for a category name argument, it writes the name of the locale category on its own separate line, sitting right before the list of keyword values for that category.

And for a keyword name argument? It writes the name of the locale category that this keyword belongs to on its own separate line, right before the keyword value.

This one is a readability upgrade when you're passing a bunch of name arguments at once. It can be combined with the -k option. ๐Ÿซถ

  • --keyword-name, -k โ€” for every keyword whose value is being displayed, the name of that keyword comes along for the ride too, so the output has this format:
keyword="value"

The locale command also knows about these options, no cap:

  • --verbose, -v โ€” displays extra information for certain command-line option and argument combos. ๐ŸŽ€
  • --help, -? โ€” displays a summary of the command-line options and arguments, then exits.
  • --usage โ€” displays a short usage message, then exits.
  • --version, -V โ€” displays the program version, then exits. โญ

๐Ÿ“ FILES ๐Ÿ“

  • /usr/lib/locale/locale-archive โ€” the usual default locale archive location.
  • /usr/share/i18n/locales โ€” the usual default path for locale definition files.

๐ŸŒˆ STANDARDS ๐ŸŒˆ

POSIX.1-2008. periodt. ๐Ÿ‘‘


๐Ÿ’œ HISTORY ๐Ÿ’œ

POSIX.1-2001. she's been iconic for a minute.


๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

first up, just run it with nothing:

$ locale;
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

now asking for one lil keyword:

$ locale date_fmt;
%a %b %e %H:%M:%S %Z %Y

same keyword, but make it โœจlabeledโœจ with -k:

$ locale -k date_fmt;
date_fmt="%a %b %e %H:%M:%S %Z %Y"

and now with -ck, so you get the category name too:

$ locale -ck date_fmt;
LC_TIME
date_fmt="%a %b %e %H:%M:%S %Z %Y"

asking for a whole category by name:

$ locale LC_TELEPHONE;
+%c (%a) %l
(%a) %l
11
1
UTF-8

same category, but now the keywords are named, which is honestly so much easier to read:

$ locale -k LC_TELEPHONE;
tel_int_fmt="+%c (%a) %l"
tel_dom_fmt="(%a) %l"
int_select="11"
int_prefix="1"
telephone-codeset="UTF-8"

and here's the main character move ๐ŸŽ€ โ€” this next example compiles a custom locale from the ./wrk directory using the localedef(1) utility under the $HOME/.locale directory, then tests the result with the date(1) command, and then sets the environment variables LOCPATH and LANG in the shell profile file so the custom locale gets used in all your subsequent user sessions:

$ mkdir -p $HOME/.locale;
$ I18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8;
$ LOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date;
$ echo "export LOCPATH=\$HOME/.locale" >> $HOME/.bashrc;
$ echo "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc;

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

localedef(1), charmap(5), locale(5), locale(7)


k that's the whole page, bestie ๐Ÿ’– this one's straight out of Linux man-pages 6.20, dated 2026-02-08 โ€” go forth and check ur locale, slay ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: Linux-man-pages-copyleft
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms