Locale and encoding
cheat sheet · Ubuntu 24.04 https://lab.dimsanych.ru/en/wiki/locale/Cheat sheet
-
localecurrent settings -
locale -aavailable locales -
sudo locale-gen ru_RU.UTF-8generate one -
sudo update-locale LANG=en_US.UTF-8system default (or localectl set-locale) -
export LC_ALL=Cstable output in scripts -
LC_ALL=C sort filea one-off byte-order sort -
localectl statusthe systemd view
Configuration
Precedence: LC_ALL (overrides everything) > specific LC_* variables >
LANG (the general default).
| Variable | Affects |
|---|---|
LANG |
the general default for all categories |
LC_CTYPE |
encoding (UTF-8!) |
LC_TIME |
date/time format (see date) |
LC_NUMERIC |
the decimal separator (. or ,) |
LC_COLLATE |
sort order (sort) |
LC_ALL |
overrides everything (for scripts: LC_ALL=C) |