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