Ubuntu Time Management

  

1. The date command is mainly used to display and modify the system time

2. The hwclock command is used to view the set hardware time, as well as the synchronization hardware time and system time

# Display hardware time hwclock # Set hardware time hwclock -set -date="03/24/14 22:22:00" #Sync hardware clock and system clock hwclock --hctosys# Synchronize system clock and hardware clock hwclock --systohc

3. ntpdate for synchronizing network time

ntpdate cn.pool.ntp.org4. Modify time zone tzselect command, navigation time zone sudo cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime5 Change Locale to modify /var/lib/locales/supported.d/local For example: en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_CN.GBK GBK zh_CN GB2312 then run locale-gen or sudo dpkg-reconfigure Locales Locale setting rules Ubuntu Locale is divided into 12 categories, namely 12 LC_*. In addition to these 12 variables can be set, for the sake of simplicity, there are two variables: LC_ALL and LANG. There is a priority relationship between them: LC_ALL > LC_* > LANG can say that LC_ALL is the highest level setting or mandatory setting, and LANG is the default setting. If you set LC_ALL=zh_CN.UTF-8, then regardless of the value set by LC_* and LANG, they will be forced to obey the LC_ALL setting and become zh_CN.UTF-8. If you set LANG=zh_CN.UTF-8, and other LC_*=en_US.UTF-8, and do not set LC_ALL, then the system's locale is set to LC_*=en_US.UTF-8. If you set LANG=zh_CN.UTF-8, and other LC_*, and LC_ALL are not set, the system will set LC_* to the default value, which is the value of LANG zh_CN.UTF-8. If you set LANG=zh_CN.UTF-8, and other LC_CTYPE=en_US.UTF-8, other LC_*, and LC_ALL are not set, then the system's locale setting will be: LC_CTYPE=en_US. UTF-8, the rest of LC_COLLATE, LC_MESSAGES, etc. will use the default value, which is the value of LANG, which is LC_COLLATE=LC_MESSAGES=……= LC_PAPER=LANG=zh_CN.UTF-8. In summary, the locale setting rule is: if you need a pure Chinese system, set LC_ALL= zh_CN.XXXX, or LANG= zh_CN.XXXX can, of course, you can set both, but as mentioned above, The value of LC_ALL will override all other locale settings. If you only want an environment where you can input Chinese, and keep the menu, title, system information, etc. as the English interface, then you only need to set LC_CTYPE=zh_CN.XXXX, LANG=en_US.XXXX. Thus LC_CTYPE=zh_CN.XXXX, and LC_COLLATE=LC_MESSAGES=……= LC_PAPER=LANG=en_US.XXXX. Finally, attach 12 types of Locale: 
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"
Copyright © Windows knowledge All Rights Reserved