Configuration | Description |
Set the system display language, date and time format, currency symbol, and so on. | |
Set the local time displayed by the system. | |
Different countries and regions may use different keyboard layouts, such as QWERTY, AZERTY, and QWERTZ. | |
Set the display style of text in the system. Different fonts may support different character sets and typographic effects. | |
Allows input of different character sets in the system, such as Chinese and Japanese. |
locale environment variables and their functions are as follows:Variable | Description |
LANG | Sets the system's default language and character encoding. Other unset LC_* variables use the value of the LANG variable. |
LC_CTYPE | Controls character classification and conversion, such as character case conversion, character sets, and encoding. Also affects character display in input methods and terminals. |
LC_NUMERIC | Controls the display format of numbers, such as decimal point symbols and thousands separators. |
LC_TIME | Controls the display format of dates and times, such as weekday names, month names, and date order. |
LC_COLLATE | Controls the rules for string comparison and sorting. Affects operations such as file name sorting and command line argument sorting. |
LC_MONETARY | Controls the display format of currency, such as currency symbols and positive and negative number representations. |
LC_MESSAGES | Controls the language of system messages and prompts. Affects text output such as program error messages and help information. |
LC_PAPER | Controls the default paper size for printing and page settings. |
LC_NAME | Controls the display format of personal names, such as name order and name abbreviations. |
LC_ADDRESS | Controls the display format of addresses, such as country names, city names, and postal codes. |
LC_TELEPHONE | Controls the display format of phone numbers, such as country codes and area codes. |
LC_MEASUREMENT | Controls the display format of measurement units, such as metric or imperial units. |
LC_IDENTIFICATION | Controls the display format of metadata, such as language codes and country codes. |
/etc/locale.conf file. The system default configuration is LANG="C.UTF-8". During initial systemd startup, this file is read to configure the system environment./etc/locale.conf file:cat /etc/locale.conf
# This is the fallback locale configuration provided by systemd.LANG="C.UTF-8"
locale command to view the current locale configuration. Any unset LC_* variables will use the value of the LANG variable:locale
LANG=C.UTF-8LC_CTYPE="C.UTF-8"LC_NUMERIC="C.UTF-8"LC_TIME="C.UTF-8"LC_COLLATE="C.UTF-8"LC_MONETARY="C.UTF-8"LC_MESSAGES="C.UTF-8"LC_PAPER="C.UTF-8"LC_NAME="C.UTF-8"LC_ADDRESS="C.UTF-8"LC_TELEPHONE="C.UTF-8"LC_MEASUREMENT="C.UTF-8"LC_IDENTIFICATION="C.UTF-8"LC_ALL=
C.UTF-8:localectl list-locales
C.UTF-8en_AU.UTF-8en_BW.UTF-8en_CA.UTF-8en_DK.UTF-8en_GB.UTF-8en_HK.UTF-8en_IE.UTF-8en_NZ.UTF-8en_PH.UTF-8en_SC.UTF-8en_SG.UTF-8en_US.UTF-8en_ZA.UTF-8en_ZW.UTF-8zh_CN.UTF-8zh_HK.UTF-8zh_SG.UTF-8zh_TW.UTF-8
language_region.character_set_encoding. Common Chinese and English locale definitions are as follows:zh_CN.UTF-8: indicates that the language is Chinese zh, the region is Chinese mainland CN, and the character set encoding is UTF-8.en_US.UTF-8: indicates that the language is English en, the region is the United States US, and the character set encoding is UTF-8.System Locale indicates the default LANG value used by the system, which defaults to C.UTF-8:localectl status
System Locale: LANG=C.UTF-8VC Keymap: n/aX11 Layout: n/a
C.UTF-8 uses standard C as the language environment, but its character encoding is UTF-8. String sorting and comparison are based on byte values rather than specific language rules, and date, time, and number formats use basic English representation. Using C.UTF-8 does not depend on specific localization settings, ensuring better compatibility and portability of programs across different systems. This system uses C.UTF-8 as the default locale.localectl command to configure the language and region. Directly modifying the /etc/locale.conf file is not recommended.sudo localectl set-locale zh_CN.UTF-8
reboot
localectl --help.Concept | Description |
Universal Time Coordinated (UTC) | The primary world time standard, based on the second length of atomic time and independent of time zones. |
Time Zone | Time standard based on the user's location. |
Hardware Clock (Real-Time Clock, RTC) | A physical clock powered by a battery on the motherboard that continues to operate normally after system power loss. |
System Clock | During system startup, the initial value is calculated based on the hardware clock. After startup, it runs independently of the hardware clock. |
timedatectl and date are commands used in Linux systems to manage and display date and time, but their features differ:Command | Description |
timedatectl | A systemd tool that focuses on managing the system clock and time zone settings and can modify both the system time and hardware time. |
date | A UNIX tool used to view and set the current date and time. It only modifies the system time and must be used with hwclock to modify the hardware time. |
timedatectl list-timezones
Africa/AbidjanAfrica/AccraAfrica/Addis_AbabaAfrica/AlgiersAfrica/AsmaraAfrica/Asmera...
timedatectl status
Local time: Mon 2023-05-08 16:19:13 CST # Local timeUniversal time: Mon 2023-05-08 08:19:13 UTC # UTC timeRTC time: Mon 2023-05-08 08:19:13 # RTC timeTime zone: Asia/Beijing (CST, +0800) # Time zoneSystem clock synchronized: no # NTP synchronization statusNTP service: active # NTP service statusRTC in local TZ: no # Whether RTC uses local time
<TIMEZONE> with the target time zone, for example, Asia/Shanghai:timedatectl set-timezone <TIMEZONE>
timedatectl set-time <YYYY-MM-DD> # Modifies only the year, month, and day of the system calendar, leaving the time unchangedtimedatectl set-time <HH:MM:SS> # Modifies only the hour, minute, and second of the system clock, leaving the date unchanged
<BOOL> with true or false. This operation modifies the status of the NTP service:timedatectl set-ntp <BOOL>
date
date --utc
date +"format". For details about the format parameter, run man date to view the manual:date +%y%m%d
230508
date +"%D %H:%M:%S"
05/08/23 17:48:31
date --set <YYYY-MM-DD> # Sets the system date to the specified value, leaving the time unchangeddate --set <HH:MM:SS> # Sets the system time to the specified value, leaving the date unchanged
hwclock
MM/DD/YYYY HH:MM with the actual date and time:hwclock --set --date "MM/DD/YYYY HH:MM"
hwclock --hctosys
hwclock --systohc
timedatectl --help or refer to man timedatectl(1), man date(1), and man hwclock(8).localectl.localectl list-keymaps
alal-plisiatat-macat-nodeadkeysazba...
localectl status
System Locale: LANG=en_US.UTF-8VC Keymap: n/aX11 Layout: n/a
us with the target keyboard layout, run the following command as the root user:sudo localectl set-keymap us
fontconfig for font management.fontconfig software package for subsequent font management operations.fontconfig:yum install fontconfig
fc-list
fc-list :lang=zh
dnf list *cjk-sc*
Last metadata expiration check: 3:44:09 ago on Thu May 25 13:03:02 2023.Available Packages# Simplified Chinese Sans-Serif Fontsgoogle-noto-sans-cjk-sc-fonts.noarch 20201206-4.ocs23 AppStream# Simplified Chinese Monospace Fontsgoogle-noto-sans-mono-cjk-sc-fonts.noarch 20201206-4.ocs23 AppStream# Simplified Chinese Serif Fontsgoogle-noto-serif-cjk-sc-fonts.noarch 20201206-4.ocs23 AppStream
dnf install google-noto-sans-cjk-sc-fonts.noarch
fc-list :lang=zh
/usr/local/share/fonts/ directory:mkdir -p /usr/local/share/fonts/new_fontscp example.ttf /usr/local/share/fonts/new_fonts
~/.local/share/fonts/ in the user's home directory:mkdir -p ~/.local/share/fonts/new_fontscp example.ttf ~/.local/share/fonts/new_fonts
fc-cache
fc-list | grep -i new_fonts
fc-match Font-Name
fc-list --help.dnf groupinstall 'Server with GUI'
systemctl set-default graphical.target
reboot
dnf install ibus-libpinyin
dnf install ibus-table-chinese-wubi-haifeng
dnf install ibus-table-chinese-wubi-jidian
reboot
Chinese (China), and add the desired input method. GNOME displays the currently selected input source on the menu bar. The default shortcut for switching input methods is Super + Space, where the Super key is usually the Windows key (logo key).dnf list ibus-table-chinese*
Last metadata expiration check: 2:34:07 ago on Thu May 25 13:03:02 2023.Available Packagesibus-table-chinese.noarch 1.8.11-3.ocs23 AppStream# Array Input Methodibus-table-chinese-array.noarch 1.8.11-3.ocs23 AppStream# Cangjie Input Methodibus-table-chinese-cangjie.noarch 1.8.11-3.ocs23 AppStream# Cantonese Input Methodibus-table-chinese-cantonese.noarch 1.8.11-3.ocs23 AppStream# Yale Romanization-Based Cantonese Input Methodibus-table-chinese-cantonyale.noarch 1.8.11-3.ocs23 AppStream# Easy Input Methodibus-table-chinese-easy.noarch 1.8.11-3.ocs23 AppStream# Two-Stroke Input Methodibus-table-chinese-erbi.noarch 1.8.11-3.ocs23 AppStream# Quick Input Methodibus-table-chinese-quick.noarch 1.8.11-3.ocs23 AppStream# Quick Cangjie Input Methodibus-table-chinese-scj.noarch 1.8.11-3.ocs23 AppStream# Stroke Order Five-Code Input Methodibus-table-chinese-stroke5.noarch 1.8.11-3.ocs23 AppStream# Shanghai Wu Phonetic Input Methodibus-table-chinese-wu.noarch 1.8.11-3.ocs23 AppStream# Haifeng Wubi Input Methodibus-table-chinese-wubi-haifeng.noarch 1.8.11-3.ocs23 AppStream# Jidian Wubi 86 Input Method with Jishuang Lexicon 6.0ibus-table-chinese-wubi-jidian.noarch 1.8.11-3.ocs23 AppStream# Yongma Input Methodibus-table-chinese-yong.noarch 1.8.11-3.ocs23 AppStream
フィードバック