Linux method 4

Source: Internet
Author: User
Tags cst time
I believe many new users who want to learn linux are wondering what linux learning courses are good. the following small series will collect and organize several important tutorials for you to learn, if you want to learn more, go to the wdlinux school to find more tutorials. 1. linux restart/shutdown command whole...

I believe many new users who want to learn linux are wondering what linux learning courses are good. the following small series will collect and organize several important tutorials for you to learn, if you want to learn more, go to the wdlinux school to find more tutorials.

1, LinuxSystem restart/Shutdown command sorting

Restart command:
1. reboot
2. shutdown-r now restarts immediately (used by the root user)
3. shutdown-r restarts automatically after 10 minutes (used by root users)
4. shutdown-r restart at (for root users)
If you use the shutdown command to set the restart, you can use the shutdown-c command to cancel the restart.

Shutdown command:
1. shut down halt immediately
2. power off immediately
3. shutdown-h now shut down immediately (used by the root user)
4. shutdown-h: shutdown automatically 10 minutes later
If you use the shutdown command to set shutdown, you can use the shutdown-c command to cancel the restart.

 

2.Cause Analysis of system time changes
Linux has two types of time: system time and hardware Time (BIOS time ).
The system reads the BIOS time every time it starts and assigns it to the system time. The system time will run independently, but the BIOS time will not change.

There are two representation formats in BIOS time. One is expressed in localtime and the other in UTC. You can run hwclock-debug to display the current hardware time.

The following describes the changes in system time in various situations:
1. when hwclock is set to localtime and UTC = true in/etc/sysconf/clock, the system time is 8 hours earlier than the BIOS time after the system is restarted.
2. when hwclock is set to localtime and UTC = false in/etc/sysconf/clock, the system time does not change relative to the BIOS time after restart.
3. when hwclock is set to UTC and UTC = true in/etc/sysconf/clock, the system time does not change relative to the BIOS time after the system is restarted.
4. when hwclock is set to UTC and UTC = false in/etc/sysconf/clock, the system time relative to the BIOS time is pushed 8 hours after the system is restarted.
As shown in:

 


UTC = true in/etc/sysconf/clock


UTC = false in/etc/sysconf/clock


Hardware time localtime


After the reboot, the system time is 8 hours earlier than the BIOS time.


System time unchanged


Hardware Time UTC


System time unchanged


After the reboot, the system time is pushed 8 hours after the BIOS time



It can be seen that when the BIOS time settings are different from those in/etc/sysconf/clock, the system time at system startup is incorrect.

If there is a script to synchronize time, but it runs after the system is started. Although time synchronization can synchronize the system time to the correct time, an incorrect time interval may occur due to the incorrect system time setting, this interval may affect programs that depend on the system time.
Countermeasure: the root cause of this problem is that the hardware Time type is inconsistent with the setting in/etc/sysconf/clock. Therefore, we will add hardware time synchronization in the time synchronization script to solve this problem.
Note:
UTC Time: The Universal Time Coordinated (UTC), that is, the Time of the 0 Time zone.
CST Time: CST China Standard Time UTC + China coastal Time (Beijing Time), which is the localtime of our Time zone.




3.Time zone settings:
To ensure that the time is correct, set the time zone correctly. The correct setting is only for better time understanding and other maintenance.

Setting method:
1.
Manually set the time zone:
For example, set the UTC + 8 time


Ln-sf/usr/share/zoneinfo/Asia/Shanghai
/Etc/localtime


Edit ZONE = "Asia/Shanghai" in/etc/sysconfig/clock"


2.

Set using graphical commands
System-config-date (RedHat and CentOS only in most cases) or tzselect can be used as instructed by the command.

 


4, LinuxSystem software installation method

There are two main types of software installation in linux:
1 Software Package Installation
2. source code compilation and installation
In fact, the software package is installed by someone else or company. The system version is compiled for a specific platform, and the package is prepared.
The source code is compiled by means of the source code, manual, configuration, compilation, and installation.
The two have their own strengths and weaknesses.
Software Package Installation
1. simple, convenient, and fast
2. select different software packages for specific environments and versions.
Source code compilation and installation
1. flexible, customizable, and optimized
2. relatively complicated and have certain basic requirements for operators
3 It takes a long time, especially some software or large software, such as mysql

For the installation of software packages, different Linux branches have different software packages.
For example, wdOS, CentOS, and Redhat all use RPM packages.
For example, Ubuntu and Debian use DEB.
But the source code installation is basically the same for all Linux and unix, except for parameters
Which one is better? No standards, depending on your needs and situations


This tutorial is taken from the wdlinux Forum http://www.wdlinux.cn/bbs ~

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.