]>
Commit | Line | Data |
---|---|---|
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 | .\" | |
4b8c67d9 | 25 | .TH LOCALE 1 2017-09-15 "Linux" "Linux User Manual" |
73155a29 MK |
26 | .SH NAME |
27 | locale \- get locale-specific information | |
28 | .SH SYNOPSIS | |
29 | .nf | |
a6db4e38 | 30 | .BR locale " [\fIoption\fP]" |
cb9dacef MK |
31 | .BR locale " [\fIoption\fP] " \-a |
32 | .BR locale " [\fIoption\fP] " \-m | |
a6db4e38 | 33 | .BR locale " [\fIoption\fP] \fIname\fP..." |
73155a29 MK |
34 | .fi |
35 | .SH DESCRIPTION | |
36 | The | |
37 | .B locale | |
38 | command displays information about the current locale, or all locales, | |
39 | on standard output. | |
2a86152e | 40 | .PP |
73155a29 MK |
41 | When invoked without arguments, |
42 | .B locale | |
43 | displays the current locale settings for each locale category (see | |
44 | .BR locale (5)), | |
45 | based on the settings of the environment variables that control the locale | |
46 | (see | |
47 | .BR locale (7)). | |
8cc4d071 | 48 | Values for variables set in the environment are printed without double |
ca48cef1 | 49 | quotes, implied values are printed with double quotes. |
2a86152e | 50 | .PP |
73155a29 MK |
51 | If either the |
52 | .B \-a | |
53 | or the | |
54 | .B \-m | |
55 | option (or one of their long-format equivalents) is specified, | |
56 | the behavior is as follows: | |
57 | .TP | |
58 | .BR \-a ", " \-\-all\-locales | |
59 | Display a list of all available locales. | |
60 | The | |
61 | .B -v | |
62 | option causes the | |
63 | .B LC_IDENTIFICATION | |
64 | metadata about each locale to be included in the output. | |
65 | .TP | |
66 | .BR \-m ", " \-\-charmaps | |
67 | Display the available charmaps (character set description files). | |
6ad542bf MM |
68 | To display the current character set for the locale, use |
69 | \fBlocale -c charmap\fR. | |
73155a29 MK |
70 | .PP |
71 | The | |
2b1887cd | 72 | .B locale |
73155a29 MK |
73 | command can also be provided with one or more arguments, |
74 | which are the names of locale keywords (for example, | |
75 | .IR date_fmt , | |
76 | .IR ctype-class-names , | |
77 | .IR yesexpr , | |
78 | or | |
79 | .IR decimal_point ) | |
80 | or locale categories (for example, | |
81 | .BR LC_CTYPE | |
82 | or | |
83 | .BR LC_TIME ). | |
84 | For each argument, the following is displayed: | |
85 | .IP * 3 | |
86 | For a locale keyword, the value of that keyword to be displayed. | |
87 | .IP * | |
88 | For a locale category, | |
89 | the values of all keywords in that category are displayed. | |
90 | .PP | |
91 | When arguments are supplied, the following options are meaningful: | |
92 | .TP | |
4edd4149 | 93 | .BR \-c ", " \-\-category\-name |
73155a29 MK |
94 | For a category name argument, |
95 | write the name of the locale category | |
96 | on a separate line preceding the list of keyword values for that category. | |
2a86152e | 97 | .IP |
73155a29 MK |
98 | For a keyword name argument, |
99 | write the name of the locale category for this keyword | |
100 | on a separate line preceding the keyword value. | |
2a86152e | 101 | .IP |
73155a29 MK |
102 | This option improves readability when multiple name arguments are specified. |
103 | It can be combined with the | |
104 | .B \-k | |
105 | option. | |
106 | .TP | |
4edd4149 | 107 | .BR \-k ", " \-\-keyword\-name |
73155a29 MK |
108 | For each keyword whose value is being displayed, |
109 | include also the name of that keyword, | |
110 | so that the output has the format: | |
2a86152e | 111 | .IP |
73155a29 | 112 | \fIkeyword\fP="\fIvalue\fP" |
73155a29 MK |
113 | .PP |
114 | The | |
2b1887cd | 115 | .B locale |
73155a29 MK |
116 | command also knows about the following options: |
117 | .TP | |
4edd4149 | 118 | .BR \-v ", " \-\-verbose |
73155a29 MK |
119 | Display additional information for some command-line option and argument |
120 | combinations. | |
121 | .TP | |
4edd4149 | 122 | .BR \-? ", " \-\-help |
73155a29 MK |
123 | Display a summary of command-line options and arguments and exit. |
124 | .TP | |
4edd4149 | 125 | .BR \-\-usage |
73155a29 MK |
126 | Display a short usage message and exit. |
127 | .TP | |
4edd4149 | 128 | .BR \-V ", " \-\-version |
73155a29 | 129 | Display the program version and exit. |
8a7f7e66 MM |
130 | .SH FILES |
131 | .TP | |
132 | .I /usr/lib/locale/locale-archive | |
133 | Usual default locale archive location. | |
134 | .TP | |
135 | .I /usr/share/i18n/locales | |
136 | Usual default path for locale definition files. | |
73155a29 | 137 | .SH CONFORMING TO |
8a7f7e66 | 138 | POSIX.1-2001, POSIX.1-2008. |
73155a29 | 139 | .SH EXAMPLE |
b76974c1 | 140 | .EX |
73155a29 MK |
141 | $ \fBlocale\fP |
142 | LANG=en_US.UTF\-8 | |
143 | LC_CTYPE="en_US.UTF\-8" | |
144 | LC_NUMERIC="en_US.UTF\-8" | |
145 | LC_TIME="en_US.UTF\-8" | |
146 | LC_COLLATE="en_US.UTF\-8" | |
147 | LC_MONETARY="en_US.UTF\-8" | |
148 | LC_MESSAGES="en_US.UTF\-8" | |
149 | LC_PAPER="en_US.UTF\-8" | |
150 | LC_NAME="en_US.UTF\-8" | |
151 | LC_ADDRESS="en_US.UTF\-8" | |
152 | LC_TELEPHONE="en_US.UTF\-8" | |
153 | LC_MEASUREMENT="en_US.UTF\-8" | |
154 | LC_IDENTIFICATION="en_US.UTF\-8" | |
4edd4149 MK |
155 | LC_ALL= |
156 | ||
73155a29 MK |
157 | $ \fBlocale date_fmt\fP |
158 | %a %b %e %H:%M:%S %Z %Y | |
4edd4149 | 159 | |
73155a29 MK |
160 | $ \fBlocale \-k date_fmt\fP |
161 | date_fmt="%a %b %e %H:%M:%S %Z %Y" | |
4edd4149 | 162 | |
73155a29 MK |
163 | $ \fBlocale \-ck date_fmt\fP |
164 | LC_TIME | |
165 | date_fmt="%a %b %e %H:%M:%S %Z %Y" | |
4edd4149 | 166 | |
f4b0ab8b MM |
167 | $ \fBlocale LC_TELEPHONE\fP |
168 | +%c (%a) %l | |
169 | (%a) %l | |
170 | 11 | |
171 | 1 | |
73155a29 | 172 | UTF\-8 |
4edd4149 | 173 | |
f4b0ab8b MM |
174 | $ \fBlocale \-k LC_TELEPHONE\fP |
175 | tel_int_fmt="+%c (%a) %l" | |
176 | tel_dom_fmt="(%a) %l" | |
177 | int_select="11" | |
178 | int_prefix="1" | |
179 | telephone\-codeset="UTF\-8" | |
b76974c1 | 180 | .EE |
2a86152e | 181 | .PP |
0cc4caa9 MM |
182 | The following example compiles a custom locale from the |
183 | .I ./wrk | |
184 | directory with the | |
185 | .BR localedef (1) | |
186 | utility under the | |
187 | .I $HOME/.locale | |
188 | directory, then tests the result with the | |
189 | .BR date (1) | |
190 | command, and then sets the environment variables | |
191 | .B LOCPATH | |
192 | and | |
193 | .B LANG | |
194 | in the shell profile file so that the custom locale will be used in the | |
195 | subsequent user sessions: | |
2a86152e | 196 | .PP |
408731d4 | 197 | .EX |
0cc4caa9 MM |
198 | $ \fBmkdir -p $HOME/.locale\fP |
199 | $ \fBI18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8\fP | |
200 | $ \fBLOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date\fP | |
201 | $ \fBecho "export LOCPATH=\\$HOME/.locale" >> $HOME/.bashrc\fP | |
202 | $ \fBecho "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc\fP | |
408731d4 | 203 | .EE |
73155a29 | 204 | .SH SEE ALSO |
0cc4caa9 | 205 | .BR localedef (1), |
8a7f7e66 | 206 | .BR charmap (5), |
73155a29 MK |
207 | .BR locale (5), |
208 | .BR locale (7) |