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ÏÂ×öcÓïÑÔ¿ª·¢
±¾ÆªÎÄÕÂÖ¼ÔÚ½éÉÜÈçºÎ¿ªÊ¼ÔÚlinuxÏÂÃæ½øÐÐCÓïÑÔ³ÌÐòÉè¼Æ£¬ÒÔ¼°ÈçºÎʹÓóÌÐòÉè¼Æ¼°µ÷ÊÔ¹¤¾ß½øÐбàдC³ÌÐò¡£Ñ§»áʹÓÃgcc¼°gdbµÈ¹¤¾ß½øÐÐlinuxϵÄc±àдºÍµ÷ÊÔ¡£
ÔÚ¿ªÊ¼Ö®Ç°£¬Ê×ÏÈҪ˵Ã÷µÄÊÇ£¬linux¿ª·¢³ÌÐò×îÖ÷ÒªµÄ±à¼Æ÷ÊÇvi/vim±à¼Æ÷£¬µ±È»»¹ÓÐemacs,gedit£¬Ö»ÊÇvi/vimµÄÓû§ÊµÔÚÊÇѹµ¹ÐԵĶàÊ ......
ÊÔÒ»ÊÔ£¬ÆäʵºÜ¼òµ¥µÄ¡£
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 ......