Debian Codegraph @

upstream/debian-trixie/man1/locale.1

raw
1 .\" Copyright (C) 2014 Michael Kerrisk <[email protected]>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH locale 1 2024-06-15 "Linux man-pages 6.9.1"
6 .SH NAME
7 locale \- get locale-specific information
8 .SH SYNOPSIS
9 .nf
10 .BR locale " [\fIoption\fP]"
11 .BR locale " [\fIoption\fP] " \-a
12 .BR locale " [\fIoption\fP] " \-m
13 .BR locale " [\fIoption\fP] \fIname\fP..."
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.
20 .P
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)).
28 Values for variables set in the environment are printed without double
29 quotes, implied values are printed with double quotes.
30 .P
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 .B \-\-all\-locales
39 .TQ
40 .B \-a
41 Display a list of all available locales.
42 The
43 .B \-v
44 option causes the
45 .B LC_IDENTIFICATION
46 metadata about each locale to be included in the output.
47 .TP
48 .B \-\-charmaps
49 .TQ
50 .B \-m
51 Display the available charmaps (character set description files).
52 To display the current character set for the locale, use
53 \fBlocale \-c charmap\fR.
54 .P
55 The
56 .B locale
57 command can also be provided with one or more arguments,
58 which are the names of locale keywords (for example,
59 .IR date_fmt ,
60 .IR ctype\-class\-names ,
61 .IR yesexpr ,
62 or
63 .IR decimal_point )
64 or locale categories (for example,
65 .B LC_CTYPE
66 or
67 .BR LC_TIME ).
68 For each argument, the following is displayed:
69 .IP \[bu] 3
70 For a locale keyword, the value of that keyword to be displayed.
71 .IP \[bu]
72 For a locale category,
73 the values of all keywords in that category are displayed.
74 .P
75 When arguments are supplied, the following options are meaningful:
76 .TP
77 .B \-\-category\-name
78 .TQ
79 .B \-c
80 For a category name argument,
81 write the name of the locale category
82 on a separate line preceding the list of keyword values for that category.
83 .IP
84 For a keyword name argument,
85 write the name of the locale category for this keyword
86 on a separate line preceding the keyword value.
87 .IP
88 This option improves readability when multiple name arguments are specified.
89 It can be combined with the
90 .B \-k
91 option.
92 .TP
93 .B \-\-keyword\-name
94 .TQ
95 .B \-k
96 For each keyword whose value is being displayed,
97 include also the name of that keyword,
98 so that the output has the format:
99 .IP
100 .in +4n
101 .EX
102 .IR keyword =\[dq] value \[dq]
103 .EE
104 .in
105 .P
106 The
107 .B locale
108 command also knows about the following options:
109 .TP
110 .B \-\-verbose
111 .TQ
112 .B \-v
113 Display additional information for some command-line option and argument
114 combinations.
115 .TP
116 .B \-\-help
117 .TQ
118 .B \-?
119 Display a summary of command-line options and arguments and exit.
120 .TP
121 .B \-\-usage
122 Display a short usage message and exit.
123 .TP
124 .B \-\-version
125 .TQ
126 .B \-V
127 Display the program version and exit.
128 .SH FILES
129 .TP
130 .I /usr/lib/locale/locale\-archive
131 Usual default locale archive location.
132 .TP
133 .I /usr/share/i18n/locales
134 Usual default path for locale definition files.
135 .SH STANDARDS
136 POSIX.1-2008.
137 .SH HISTORY
138 POSIX.1-2001.
139 .SH EXAMPLES
140 .EX
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"
155 LC_ALL=
156 .P
157 $ \fBlocale date_fmt\fP
158 %a %b %e %H:%M:%S %Z %Y
159 .P
160 $ \fBlocale \-k date_fmt\fP
161 date_fmt="%a %b %e %H:%M:%S %Z %Y"
162 .P
163 $ \fBlocale \-ck date_fmt\fP
164 LC_TIME
165 date_fmt="%a %b %e %H:%M:%S %Z %Y"
166 .P
167 $ \fBlocale LC_TELEPHONE\fP
168 +%c (%a) %l
169 (%a) %l
170 11
171 1
172 UTF\-8
173 .P
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"
180 .EE
181 .P
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:
196 .P
197 .EX
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=\[rs]$HOME/.locale" >> $HOME/.bashrc\fP
202 $ \fBecho "export LANG=fi_SE.UTF\-8" >> $HOME/.bashrc\fP
203 .EE
204 .SH SEE ALSO
205 .BR localedef (1),
206 .BR charmap (5),
207 .BR locale (5),
208 .BR locale (7)