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