]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man1/locale.1
rename.2: SEE ALSO: add rename(1)
[thirdparty/man-pages.git] / man1 / locale.1
index 9e981864620c2669a76b89c4abbe2ea60214f14c..fad256a678aae4c6c81fe52fc547ee2cdf55f632 100644 (file)
 .\" the source, must acknowledge the copyright and authors of this work.
 .\" %%%LICENSE_END
 .\"
-.TH LOCALE 1 2014-03-10 "Linux" "Linux Programmer's Manual"
+.TH LOCALE 1 2019-03-06 "Linux" "Linux User Manual"
 .SH NAME
 locale \- get locale-specific information
 .SH SYNOPSIS
 .nf
-.BR locale " [OPTION]"
-.BR locale " [OPTION] \-a"
-.BR locale " [OPTION] \-m"
-.BR locale " [OPTION] NAME..."
+.BR locale " [\fIoption\fP]"
+.BR locale " [\fIoption\fP] " \-a
+.BR locale " [\fIoption\fP] " \-m
+.BR locale " [\fIoption\fP] \fIname\fP..."
 .fi
 .SH DESCRIPTION
 The
 .B locale
 command displays information about the current locale, or all locales,
 on standard output.
-
+.PP
 When invoked without arguments,
 .B locale
 displays the current locale settings for each locale category (see
@@ -45,7 +45,9 @@ displays the current locale settings for each locale category (see
 based on the settings of the environment variables that control the locale
 (see
 .BR locale (7)).
-
+Values for variables set in the environment are printed without double
+quotes, implied values are printed with double quotes.
+.PP
 If either the
 .B \-a
 or the
@@ -63,9 +65,11 @@ metadata about each locale to be included in the output.
 .TP
 .BR \-m ", " \-\-charmaps
 Display the available charmaps (character set description files).
+To display the current character set for the locale, use
+\fBlocale -c charmap\fR.
 .PP
 The
-.I locale
+.B locale
 command can also be provided with one or more arguments,
 which are the names of locale keywords (for example,
 .IR date_fmt ,
@@ -74,7 +78,7 @@ which are the names of locale keywords (for example,
 or
 .IR decimal_point )
 or locale categories (for example,
-.BR LC_CTYPE
+.B LC_CTYPE
 or
 .BR LC_TIME ).
 For each argument, the following is displayed:
@@ -86,48 +90,54 @@ the values of all keywords in that category are displayed.
 .PP
 When arguments are supplied, the following options are meaningful:
 .TP
-.BR "\-c" ", " \-\-category\-name"
+.BR \-c ", " \-\-category\-name
 For a category name argument,
 write the name of the locale category
 on a separate line preceding the list of keyword values for that category.
-
+.IP
 For a keyword name argument,
 write the name of the locale category for this keyword
 on a separate line preceding the keyword value.
-
+.IP
 This option improves readability when multiple name arguments are specified.
 It can be combined with the
 .B \-k
 option.
 .TP
-.BR "\-k" ", " "\-\-keyword\-name"
+.BR \-k ", " \-\-keyword\-name
 For each keyword whose value is being displayed,
 include also the name of that keyword,
 so that the output has the format:
-
+.IP
     \fIkeyword\fP="\fIvalue\fP"
-
 .PP
 The
-.I locale
+.B locale
 command also knows about the following options:
 .TP
-.BR "\-v" ", " "\-\-verbose"
+.BR \-v ", " \-\-verbose
 Display additional information for some command-line option and argument
 combinations.
 .TP
-.BR "\-?" ", " "\-\-help"
+.BR \-? ", " \-\-help
 Display a summary of command-line options and arguments and exit.
 .TP
-.BR "\-\-usage"
+.B \-\-usage
 Display a short usage message and exit.
 .TP
-.BR "\-V" ", " "\-\-version"
+.BR \-V ", " \-\-version
 Display the program version and exit.
+.SH FILES
+.TP
+.I /usr/lib/locale/locale-archive
+Usual default locale archive location.
+.TP
+.I /usr/share/i18n/locales
+Usual default path for locale definition files.
 .SH CONFORMING TO
-POSIX.1-2001, POSIX.1-2008
+POSIX.1-2001, POSIX.1-2008.
 .SH EXAMPLE
-.nf
+.EX
 $ \fBlocale\fP
 LANG=en_US.UTF\-8
 LC_CTYPE="en_US.UTF\-8"
@@ -142,27 +152,57 @@ LC_ADDRESS="en_US.UTF\-8"
 LC_TELEPHONE="en_US.UTF\-8"
 LC_MEASUREMENT="en_US.UTF\-8"
 LC_IDENTIFICATION="en_US.UTF\-8"
-LC_ALL=en_US.UTF\-8
+LC_ALL=
+
 $ \fBlocale date_fmt\fP
 %a %b %e %H:%M:%S %Z %Y
+
 $ \fBlocale \-k date_fmt\fP
 date_fmt="%a %b %e %H:%M:%S %Z %Y"
+
 $ \fBlocale \-ck date_fmt\fP
 LC_TIME
 date_fmt="%a %b %e %H:%M:%S %Z %Y"
-$ \fBlocale LC_MESSAGES\fP
-^[yY].*
-^[nN].*
-Yes
-No
+
+$ \fBlocale LC_TELEPHONE\fP
++%c (%a) %l
+(%a) %l
+11
+1
 UTF\-8
-$ \fBlocale \-k LC_MESSAGES\fP
-yesexpr="^[yY].*"
-noexpr="^[nN].*"
-yesstr="Yes"
-nostr="No"
-messages\-codeset="UTF\-8"
-.fi
+
+$ \fBlocale \-k LC_TELEPHONE\fP
+tel_int_fmt="+%c (%a) %l"
+tel_dom_fmt="(%a) %l"
+int_select="11"
+int_prefix="1"
+telephone\-codeset="UTF\-8"
+.EE
+.PP
+The following example compiles a custom locale from the
+.I ./wrk
+directory with the
+.BR localedef (1)
+utility under the
+.I $HOME/.locale
+directory, then tests the result with the
+.BR date (1)
+command, and then sets the environment variables
+.B LOCPATH
+and
+.B LANG
+in the shell profile file so that the custom locale will be used in the
+subsequent user sessions:
+.PP
+.EX
+$ \fBmkdir -p $HOME/.locale\fP
+$ \fBI18NPATH=./wrk/ localedef -f UTF-8 -i fi_SE $HOME/.locale/fi_SE.UTF-8\fP
+$ \fBLOCPATH=$HOME/.locale LC_ALL=fi_SE.UTF-8 date\fP
+$ \fBecho "export LOCPATH=\e$HOME/.locale" >> $HOME/.bashrc\fP
+$ \fBecho "export LANG=fi_SE.UTF-8" >> $HOME/.bashrc\fP
+.EE
 .SH SEE ALSO
+.BR localedef (1),
+.BR charmap (5),
 .BR locale (5),
 .BR locale (7)