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