294 lines
6.8 KiB
HTML
294 lines
6.8 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LOCALE</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LOCALE</H1>
|
|
Section: Linux User Manual (1)<BR>Updated: 2019-03-06<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
locale - get locale-specific information
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
<B>locale</B> [<I>option</I>]
|
|
<B>locale</B> [<I>option</I>] <B>-a</B>
|
|
<B>locale</B> [<I>option</I>] <B>-m</B>
|
|
<B>locale</B> [<I>option</I>] <I>name</I>...
|
|
</PRE>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>locale</B>
|
|
|
|
command displays information about the current locale, or all locales,
|
|
on standard output.
|
|
<P>
|
|
|
|
When invoked without arguments,
|
|
<B>locale</B>
|
|
|
|
displays the current locale settings for each locale category (see
|
|
<B><A HREF="/cgi-bin/man/man2html?5+locale">locale</A></B>(5)),
|
|
|
|
based on the settings of the environment variables that control the locale
|
|
(see
|
|
<B><A HREF="/cgi-bin/man/man2html?7+locale">locale</A></B>(7)).
|
|
|
|
Values for variables set in the environment are printed without double
|
|
quotes, implied values are printed with double quotes.
|
|
<P>
|
|
|
|
If either the
|
|
<B>-a</B>
|
|
|
|
or the
|
|
<B>-m</B>
|
|
|
|
option (or one of their long-format equivalents) is specified,
|
|
the behavior is as follows:
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-a</B>, <B>--all-locales</B>
|
|
|
|
<DD>
|
|
Display a list of all available locales.
|
|
The
|
|
<B>-v</B>
|
|
|
|
option causes the
|
|
<B>LC_IDENTIFICATION</B>
|
|
|
|
metadata about each locale to be included in the output.
|
|
<DT id="2"><B>-m</B>, <B>--charmaps</B>
|
|
|
|
<DD>
|
|
Display the available charmaps (character set description files).
|
|
To display the current character set for the locale, use
|
|
<B>locale -c charmap</B>.
|
|
</DL>
|
|
<P>
|
|
|
|
The
|
|
<B>locale</B>
|
|
|
|
command can also be provided with one or more arguments,
|
|
which are the names of locale keywords (for example,
|
|
<I>date_fmt</I>,
|
|
|
|
<I>ctype-class-names</I>,
|
|
|
|
<I>yesexpr</I>,
|
|
|
|
or
|
|
<I>decimal_point</I>)
|
|
|
|
or locale categories (for example,
|
|
<B>LC_CTYPE</B>
|
|
|
|
or
|
|
<B>LC_TIME</B>).
|
|
|
|
For each argument, the following is displayed:
|
|
<DL COMPACT>
|
|
<DT id="3">*<DD>
|
|
For a locale keyword, the value of that keyword to be displayed.
|
|
<DT id="4">*<DD>
|
|
For a locale category,
|
|
the values of all keywords in that category are displayed.
|
|
</DL>
|
|
<P>
|
|
|
|
When arguments are supplied, the following options are meaningful:
|
|
<DL COMPACT>
|
|
<DT id="5"><B>-c</B>, <B>--category-name</B>
|
|
|
|
<DD>
|
|
For a category name argument,
|
|
write the name of the locale category
|
|
on a separate line preceding the list of keyword values for that category.
|
|
<DT id="6"><DD>
|
|
For a keyword name argument,
|
|
write the name of the locale category for this keyword
|
|
on a separate line preceding the keyword value.
|
|
<DT id="7"><DD>
|
|
This option improves readability when multiple name arguments are specified.
|
|
It can be combined with the
|
|
<B>-k</B>
|
|
|
|
option.
|
|
<DT id="8"><B>-k</B>, <B>--keyword-name</B>
|
|
|
|
<DD>
|
|
For each keyword whose value is being displayed,
|
|
include also the name of that keyword,
|
|
so that the output has the format:
|
|
<DT id="9"><DD>
|
|
<BR> <I>keyword</I>="<I>value</I>"
|
|
</DL>
|
|
<P>
|
|
|
|
The
|
|
<B>locale</B>
|
|
|
|
command also knows about the following options:
|
|
<DL COMPACT>
|
|
<DT id="10"><B>-v</B>, <B>--verbose</B>
|
|
|
|
<DD>
|
|
Display additional information for some command-line option and argument
|
|
combinations.
|
|
<DT id="11"><B>-?</B>, <B>--help</B>
|
|
|
|
<DD>
|
|
Display a summary of command-line options and arguments and exit.
|
|
<DT id="12"><B>--usage</B>
|
|
|
|
<DD>
|
|
Display a short usage message and exit.
|
|
<DT id="13"><B>-V</B>, <B>--version</B>
|
|
|
|
<DD>
|
|
Display the program version and exit.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="14"><I>/usr/lib/locale/locale-archive</I>
|
|
|
|
<DD>
|
|
Usual default locale archive location.
|
|
<DT id="15"><I>/usr/share/i18n/locales</I>
|
|
|
|
<DD>
|
|
Usual default path for locale definition files.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>CONFORMING TO</H2>
|
|
|
|
POSIX.1-2001, POSIX.1-2008.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXAMPLE</H2>
|
|
|
|
|
|
$ <B>locale</B>
|
|
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=
|
|
<P>
|
|
$ <B>locale date_fmt</B>
|
|
%a %b %e %H:%M:%S %Z %Y
|
|
<P>
|
|
$ <B>locale -k date_fmt</B>
|
|
date_fmt="%a %b %e %H:%M:%S %Z %Y"
|
|
<P>
|
|
$ <B>locale -ck date_fmt</B>
|
|
LC_TIME
|
|
date_fmt="%a %b %e %H:%M:%S %Z %Y"
|
|
<P>
|
|
$ <B>locale LC_TELEPHONE</B>
|
|
+%c (%a) %l
|
|
(%a) %l
|
|
11
|
|
1
|
|
UTF-8
|
|
<P>
|
|
$ <B>locale -k LC_TELEPHONE</B>
|
|
tel_int_fmt="+%c (%a) %l"
|
|
tel_dom_fmt="(%a) %l"
|
|
int_select="11"
|
|
int_prefix="1"
|
|
telephone-codeset="UTF-8"
|
|
|
|
<P>
|
|
|
|
The following example compiles a custom locale from the
|
|
<I>./wrk</I>
|
|
|
|
directory with the
|
|
<B><A HREF="/cgi-bin/man/man2html?1+localedef">localedef</A></B>(1)
|
|
|
|
utility under the
|
|
<I>$HOME/.locale</I>
|
|
|
|
directory, then tests the result with the
|
|
<B><A HREF="/cgi-bin/man/man2html?1+date">date</A></B>(1)
|
|
|
|
command, and then sets the environment variables
|
|
<B>LOCPATH</B>
|
|
|
|
and
|
|
<B>LANG</B>
|
|
|
|
in the shell profile file so that the custom locale will be used in the
|
|
subsequent user sessions:
|
|
<P>
|
|
|
|
|
|
$ <B>mkdir -p $HOME/.locale</B>
|
|
$ <B>I18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8</B>
|
|
$ <B>LOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date</B>
|
|
$ <B>echo "export LOCPATH=\$HOME/.locale" >> $HOME/.bashrc</B>
|
|
$ <B>echo "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc</B>
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+localedef">localedef</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+charmap">charmap</A></B>(5),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+locale">locale</A></B>(5),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+locale">locale</A></B>(7)
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="16"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="17"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="18"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="19"><A HREF="#lbAE">FILES</A><DD>
|
|
<DT id="20"><A HREF="#lbAF">CONFORMING TO</A><DD>
|
|
<DT id="21"><A HREF="#lbAG">EXAMPLE</A><DD>
|
|
<DT id="22"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="23"><A HREF="#lbAI">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:18 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|