]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man1/locale.1
ldd.1, sprof.1, accept.2, alarm.2, bind.2, chdir.2, clock_nanosleep.2, close.2, conne...
[thirdparty/man-pages.git] / man1 / locale.1
CommitLineData
73155a29
MK
1.\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
2.\"
3.\" %%%LICENSE_START(VERBATIM)
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
12.\"
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
23.\" %%%LICENSE_END
24.\"
5722c835 25.TH LOCALE 1 2015-07-23 "Linux" "Linux User Manual"
73155a29
MK
26.SH NAME
27locale \- get locale-specific information
28.SH SYNOPSIS
29.nf
a6db4e38
MK
30.BR locale " [\fIoption\fP]"
31.BR locale " [\fIoption\fP] \-a"
32.BR locale " [\fIoption\fP] \-m"
33.BR locale " [\fIoption\fP] \fIname\fP..."
73155a29
MK
34.fi
35.SH DESCRIPTION
36The
37.B locale
38command displays information about the current locale, or all locales,
39on standard output.
40
41When invoked without arguments,
42.B locale
43displays the current locale settings for each locale category (see
44.BR locale (5)),
45based on the settings of the environment variables that control the locale
46(see
47.BR locale (7)).
8cc4d071 48Values for variables set in the environment are printed without double
ca48cef1 49quotes, implied values are printed with double quotes.
73155a29
MK
50
51If either the
52.B \-a
53or the
54.B \-m
55option (or one of their long-format equivalents) is specified,
56the behavior is as follows:
57.TP
58.BR \-a ", " \-\-all\-locales
59Display a list of all available locales.
60The
61.B -v
62option causes the
63.B LC_IDENTIFICATION
64metadata about each locale to be included in the output.
65.TP
66.BR \-m ", " \-\-charmaps
67Display the available charmaps (character set description files).
68.PP
69The
2b1887cd 70.B locale
73155a29
MK
71command can also be provided with one or more arguments,
72which are the names of locale keywords (for example,
73.IR date_fmt ,
74.IR ctype-class-names ,
75.IR yesexpr ,
76or
77.IR decimal_point )
78or locale categories (for example,
79.BR LC_CTYPE
80or
81.BR LC_TIME ).
82For each argument, the following is displayed:
83.IP * 3
84For a locale keyword, the value of that keyword to be displayed.
85.IP *
86For a locale category,
87the values of all keywords in that category are displayed.
88.PP
89When arguments are supplied, the following options are meaningful:
90.TP
4edd4149 91.BR \-c ", " \-\-category\-name
73155a29
MK
92For a category name argument,
93write the name of the locale category
94on a separate line preceding the list of keyword values for that category.
95
96For a keyword name argument,
97write the name of the locale category for this keyword
98on a separate line preceding the keyword value.
99
100This option improves readability when multiple name arguments are specified.
101It can be combined with the
102.B \-k
103option.
104.TP
4edd4149 105.BR \-k ", " \-\-keyword\-name
73155a29
MK
106For each keyword whose value is being displayed,
107include also the name of that keyword,
108so that the output has the format:
109
110 \fIkeyword\fP="\fIvalue\fP"
73155a29
MK
111.PP
112The
2b1887cd 113.B locale
73155a29
MK
114command also knows about the following options:
115.TP
4edd4149 116.BR \-v ", " \-\-verbose
73155a29
MK
117Display additional information for some command-line option and argument
118combinations.
119.TP
4edd4149 120.BR \-? ", " \-\-help
73155a29
MK
121Display a summary of command-line options and arguments and exit.
122.TP
4edd4149 123.BR \-\-usage
73155a29
MK
124Display a short usage message and exit.
125.TP
4edd4149 126.BR \-V ", " \-\-version
73155a29 127Display the program version and exit.
8a7f7e66
MM
128.SH FILES
129.TP
130.I /usr/lib/locale/locale-archive
131Usual default locale archive location.
132.TP
133.I /usr/share/i18n/locales
134Usual default path for locale definition files.
73155a29 135.SH CONFORMING TO
8a7f7e66 136POSIX.1-2001, POSIX.1-2008.
73155a29
MK
137.SH EXAMPLE
138.nf
139$ \fBlocale\fP
140LANG=en_US.UTF\-8
141LC_CTYPE="en_US.UTF\-8"
142LC_NUMERIC="en_US.UTF\-8"
143LC_TIME="en_US.UTF\-8"
144LC_COLLATE="en_US.UTF\-8"
145LC_MONETARY="en_US.UTF\-8"
146LC_MESSAGES="en_US.UTF\-8"
147LC_PAPER="en_US.UTF\-8"
148LC_NAME="en_US.UTF\-8"
149LC_ADDRESS="en_US.UTF\-8"
150LC_TELEPHONE="en_US.UTF\-8"
151LC_MEASUREMENT="en_US.UTF\-8"
152LC_IDENTIFICATION="en_US.UTF\-8"
4edd4149
MK
153LC_ALL=
154
73155a29
MK
155$ \fBlocale date_fmt\fP
156%a %b %e %H:%M:%S %Z %Y
4edd4149 157
73155a29
MK
158$ \fBlocale \-k date_fmt\fP
159date_fmt="%a %b %e %H:%M:%S %Z %Y"
4edd4149 160
73155a29
MK
161$ \fBlocale \-ck date_fmt\fP
162LC_TIME
163date_fmt="%a %b %e %H:%M:%S %Z %Y"
4edd4149 164
f4b0ab8b
MM
165$ \fBlocale LC_TELEPHONE\fP
166+%c (%a) %l
167(%a) %l
16811
1691
73155a29 170UTF\-8
4edd4149 171
f4b0ab8b
MM
172$ \fBlocale \-k LC_TELEPHONE\fP
173tel_int_fmt="+%c (%a) %l"
174tel_dom_fmt="(%a) %l"
175int_select="11"
176int_prefix="1"
177telephone\-codeset="UTF\-8"
73155a29 178.fi
0cc4caa9
MM
179
180The following example compiles a custom locale from the
181.I ./wrk
182directory with the
183.BR localedef (1)
184utility under the
185.I $HOME/.locale
186directory, then tests the result with the
187.BR date (1)
188command, and then sets the environment variables
189.B LOCPATH
190and
191.B LANG
192in the shell profile file so that the custom locale will be used in the
193subsequent user sessions:
194
195.nf
196$ \fBmkdir -p $HOME/.locale\fP
197$ \fBI18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8\fP
198$ \fBLOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date\fP
199$ \fBecho "export LOCPATH=\\$HOME/.locale" >> $HOME/.bashrc\fP
200$ \fBecho "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc\fP
201.fi
73155a29 202.SH SEE ALSO
0cc4caa9 203.BR localedef (1),
8a7f7e66 204.BR charmap (5),
73155a29
MK
205.BR locale (5),
206.BR locale (7)