I know in order to understand how commands work, we should use man page. But for command locale and locale-gen. I did not got the exact meaning and their duty. I need some more description about their jobs and the relation between locale and locale-gen. Based on man locale:
locale - Get locale-specific information.
ok what is locale??
DESCRIPTION The locale program writes information about the current locale environ��� ment, or all locales, to standard output.
what is locale environment?
From Wikipedia :
The
locale
programs will output a set of shell variables and their values. These are the variables that alter the behaviour of some commands regarding the language, character sets usage and so on. From my system :This tells those commands, which listen, to use American English and UTF8 encoding for the special characters. If I change the value of LANG and put fr_FR.UTF-8 instead, then commands, that support it, will write their output in French instead of English. Of course, only, if the French translation is installed.
For the
locale-gen
command, I think that the first paragraph of its man page is self-explaining :When you run
locale-gen
orlocale-gen <locale code>
you compile the needed locale file(s), allowing commands to use the locale specified within the environments variables displayed bylocale
.Example:
locale-gen en_US.UTF8
You can get the available locale codes by using the command
locale -a
.