linux time synchronization (linux 时间同步设置)
1.check ntp is installed or not
[root@myvm1 server-tar]# whereis npt
npt:
#:(..not install
2.get ntp from official website(http://psp2.ntp.org/bin/view/Main/SoftwareDownloads) and install.
[root@myvm1 server-tar]# wget http://archive.ntp.org/ntp4/ntp-4.2/ntp-4.2.6.tar.gz
[root@myvm1 server-tar]#cp ntp-4.2.6.tar.gz ../
[root@myvm1 server-tar]#cd ..
[root@myvm1 server-tar]#tar -zxvf ntp-4.2.6.tar.gz
[root@myvm1 server-tar]#cd ntp-4.2.6
[root@myvm1 ntp-4.2.6]# vim README
[root@myvm1 ntp-4.2.6]# vim INSTALL
[root@myvm1 ntp-4.2.6]# ./configure --help
######################
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
######################
i will install it in the path "/usr/local/ntp"
[root@myvm1 ntp-4.2.6]# mkdir /usr/local/ntp
[root@myvm1 ntp-4.2.6]# ./configure --prefix=/usr/local/ntp
[root@myvm1 ntp-4.2.6]# make
[root@myvm1 ntp-4.2.6]# make install
[root@myvm1 ntp-4.2.6]# whereis ntp
ntp: /usr/local/ntp
#synchronization time from time server(time.nist.gov).
[root@myvm1 ntp-4.2.6]# date
Tue Feb 2 18:59:22 CST 2010
[root@myvm1 ntp-4.2.6]# /usr/local/ntp/bin/ntpdate time.nist.gov
[root@myvm1 ntp-4.2.6]# hwclock -w
#write time into bios
[root@myvm1 ntp-4.2.6]# date
Sat Feb 20 10:29:59 CST 2010
#successful!
#you must create crontab list to make sure synchronize time.
#########
#Update Time Everyday
0 0 * * * /usr/local/ntp/bin/ntpdate time.nist.gov > /dev/null 2>&1
相关文档:
文档创建日期:2010-02-18
01 // P173: 2.编程题 (5)输入一个字符串,统计英文字母、空格、数字和其他字符的个数。
02
03 // The beginning of C program: test06-05.c.
04  ......
花了一个周末的时间列出来的。共享出来,希望大家花几分钟看看。这也算是LINUX下比较实用的查找方式了
which(寻找“执行文件”)
[root@localhost home]# which [-a] command
-a : 将所有可找到的命令均列出,而不仅仅列出第一个找到的命令名称
范例:
[root@localhost home]# which passwd
/usr/bin/passwd ......
Linux下关机最要有以下方法,我想这些方法足以满足你的需要:
[root@localhost /]# shutdown [-t秒] [-arkhcncfF] [时间] [提示信息]
[root@localhost /]# shutdown -h 10 'I will shutdown after 10 mins'
-t sec : -t 后加秒数,即‘过几秒钟后关机’的意思。
-k : 不要真的关机,只是发送提示信息。
......
Linux
版本
一览
Linux
是一套免费使用和自由传播的类
Unix
操作系统。我们通常所说的
Linux
,指的是
GNU/Linux
,即采用
Linux
内核的
GNU
操作系统。由于
Linux
是一个内核,它只是操作系统的核心,负责控制硬件、管理文件系统、程序进程等。然而一个完整的操作系统不仅仅是内核 ......