Linux command to view and modify the time zone and time
Source: Internet
Author: User
Linux view and modify the time zone, time command 1, view, modify Linux time zone and time 1, linux time zone view and modify 1, view the current time zone date-R2, modify the set time zone Method 1: tzselect Method 2: Limited to RedHatLinux and CentOStimeconfig method 3: Applicable to Linux commands for viewing and modifying time zones and Time 1. viewing and modifying Linux time zones I. viewing and modifying linux time zones 1, view the current time zone date-R 2, modify the time zone setting Method 1: tzselect Method 2: only applicable to RedHat Linux and CentOStimeconfig method 3: Applicable to Debiandpkg-reconfigure tzdata 3, copy the corresponding time zone file, replace the system time zone file, or create the link file cp/usr/share/zoneinfo/$ Main time zone/$ time zone/etc/localtime in China: cp/usr/share/zoneinfo/ Sia/Shanghai/etc/localtime 2. view and modify linux Time 1. view the time and date 2. set the time and date to set the system date to the date-s June 10, 1996 command on January 1, 06/22. /96 set the system time to 01:52:00 P.M. command date-s 13:52:00 3. write the current time and date to the BIOS, avoid Failure after restart hwclock-w III. scheduled synchronization time *****/usr/sbin/ntpdate 210.72.145.44>/dev/null 2> & 1 Linux for clock viewing and setting the commands include date, hwclock, and clock. Among them, clock and hwclock use similar, just use one line, but clock commands not only support x86 hardware system, but also support Alpha hardware system. View Linux system Time: date modify Linux system Time: date-s (followed by time) view Linux hardware Time: java code hwclock # or clock # or hwclock-show # or clock-show to modify Linux hardware Time: C code hwclock-set-date # or clock-set-date synchronizes the system time with the hardware clock. use the following code: C code hwclock-hctosys # or clock-hctosys, synchronize the hardware clock with the system time: C code hwclock-systohc # or clock-systohc enables the system to synchronize the hardware time every ten minutes. C code [hqw @ localhost root] $ vi/etc/crontab SHELL =/bin/bash PATH =/sbin:/bin:/usr/sbin: /usr/bin MAILTO = root HOME =/# run-parts 01 ***** root run-parts/etc/cron. hourly 02 4 *** root run-parts/etc/cron. daily 22 4 ** 0 root run-parts/etc/cron. weekly 42 4 1 ** root run-parts/etc/cron. monthly */10 * root hwclock -- hctosys # add this row and run hwclock -- hctosys every 10 minutes.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service