Debian Codegraph @

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