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
相关文档:
查看系统的磁盘信息:
fdisk -l
[root@localhost home]# fdisk -l
Disk /dev/hda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 979 7759395 ......
花了一个周末的时间列出来的。共享出来,希望大家花几分钟看看。这也算是LINUX下比较实用的查找方式了
which(寻找“执行文件”)
[root@localhost home]# which [-a] command
-a : 将所有可找到的命令均列出,而不仅仅列出第一个找到的命令名称
范例:
[root@localhost home]# which passwd
/usr/bin/passwd ......
试一试,其实很简单的。
mkdir -m 775 filename
-m : 设置文件的权限。直接设置,不需要默认权限。
[root@localhost home]# mkdir text1
[root@localhost home]# mkdir -m 777 text2
[root@localhost home]# ls -l
drwxr-xr-x 2 root root 4096 2010-1-19 08:03 text1
drwxrwxrwx 2 root root 4096 2010-1-19 08:04 ......
kernel.shmall = 268435456
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_tw_buckets = 5000
net.ip ......
HOSTCC scripts/mod/sumversion.o
scripts/mod/sumversion.c: In function ‘get_src_version’:
scripts/mod/sumversion.c:384: error: ‘PATH_MAX’ undeclared (first use in
this function)
scripts/mod/sumversion.c:384: error: (Each undeclared identifier is reported
only once
script ......