man-pages/man1/locale.1.html
2021-03-31 01:06:50 +01:00

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">&nbsp;</A>
<H2>NAME</H2>
locale - get locale-specific information
<A NAME="lbAC">&nbsp;</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">&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;<I>keyword</I>=&quot;<I>value</I>&quot;
</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">&nbsp;</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">&nbsp;</A>
<H2>CONFORMING TO</H2>
POSIX.1-2001, POSIX.1-2008.
<A NAME="lbAG">&nbsp;</A>
<H2>EXAMPLE</H2>
$ <B>locale</B>
LANG=en_US.UTF-8
LC_CTYPE=&quot;en_US.UTF-8&quot;
LC_NUMERIC=&quot;en_US.UTF-8&quot;
LC_TIME=&quot;en_US.UTF-8&quot;
LC_COLLATE=&quot;en_US.UTF-8&quot;
LC_MONETARY=&quot;en_US.UTF-8&quot;
LC_MESSAGES=&quot;en_US.UTF-8&quot;
LC_PAPER=&quot;en_US.UTF-8&quot;
LC_NAME=&quot;en_US.UTF-8&quot;
LC_ADDRESS=&quot;en_US.UTF-8&quot;
LC_TELEPHONE=&quot;en_US.UTF-8&quot;
LC_MEASUREMENT=&quot;en_US.UTF-8&quot;
LC_IDENTIFICATION=&quot;en_US.UTF-8&quot;
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=&quot;%a %b %e %H:%M:%S %Z %Y&quot;
<P>
$ <B>locale -ck date_fmt</B>
LC_TIME
date_fmt=&quot;%a %b %e %H:%M:%S %Z %Y&quot;
<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=&quot;+%c (%a) %l&quot;
tel_dom_fmt=&quot;(%a) %l&quot;
int_select=&quot;11&quot;
int_prefix=&quot;1&quot;
telephone-codeset=&quot;UTF-8&quot;
<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 &quot;export LOCPATH=\$HOME/.locale&quot; &gt;&gt; $HOME/.bashrc</B>
$ <B>echo &quot;export LANG=fi_SE.UTF-8&quot; &gt;&gt; $HOME/.bashrc</B>
<A NAME="lbAH">&nbsp;</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">&nbsp;</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">&nbsp;</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>