Display locales with locale command
In this step, you will learn about locales in Linux and how to display them using the locale
command.
Locales are a set of parameters that define the user's language, region, and any special variant preferences that the user wants to see in their user interface. They affect things like:
- The language used for messages and menus.
- The format for dates and times.
- The currency symbol.
- The character encoding.
Understanding locales is important for ensuring your Linux environment behaves as expected for your language and region.
To display the current locale settings, open your terminal and type the following command:
locale
Press Enter.
You will see output similar to this:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
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=
This output shows various LC_*
variables and the LANG
variable, which together define your locale. en_US.UTF-8
indicates English language, United States region, and UTF-8 character encoding.
You can also display a specific locale setting by providing its name as an argument to the locale
command. For example, to see just the language setting:
locale LANG
Press Enter.
You should see:
LANG=en_US.UTF-8
This command is useful for quickly checking how your system is configured for language and regional settings.
Click Continue to proceed to the next step.