原创 dns(domain name server) 主從
安裝dns組件[root@localhost ~]# yum install -y bind bind-utils查看dns指向[root@localhost ~]# cat /etc/resolv.conf查看根域配置文件[root@lo
原创 shell數組
shell數組定義數組[root@localhost test]# a=(1 2 3)輸出整個數組[root@localhost test]# echo ${a[@]}1 2 3輸出指定數組元素[root@localhost test]#
原创 我的友情鏈接
51CTO博客開發
原创 shell函數
shell函數用法一、用戶自定義函數及調用,函數內部變量可以在外部調用,如本腳本末行調用的是mysum函數內的變量sum[root@localhost test]# cat void.sh#!/bin/bashfunction mysum(
原创 zabbix 監控
zabbix 服務端[root@localhost ~]# yum install -y epel-release ; yum install -y httpd mysql mysql-libs php php-mysql mysql-se
原创 shell if else 判斷
sh -x 顯示腳本執行過程[root@localhost ~]# cat 2.sh#!/bin/bashecho "hello"[root@localhost ~]# sh -x 2.sh+ echo hellohello數學運算[roo
原创 Memcached
安裝memcached[root@localhost ~]# yum install -y epel-release ; yum install -y libevent memcached libmemcached啓動程序[root@loc
原创 shell中斷,繼續與退出
shell中斷,繼續與退出用法一、break退出整個循環[root@localhost test]# cat 10.sh#!/bin/bashfor i in `seq 1 10`doecho $iif [ $i -eq 4 ]thenbr
原创 shell while 循環
認識while循環用法一、死循環,:在while循環裏面表示永久爲真[root@localhost test]# cat 7.sh#!/bin/bashwhile :dodate +%Tsleep 5done用法二、順序輸出1-10[roo
原创 shell for
認識for循環結構用法一、順序輸出1-10[root@localhost test]# cat 6.sh#!/bin/bashfor i in `seq 1 10`doecho $idone用法二、計算1-10的和[root@localho
原创 我的友情鏈接
51CTO博客開發
原创 shell函數
shell函數用法一、用戶自定義函數及調用,函數內部變量可以在外部調用,如本腳本末行調用的是mysum函數內的變量sum[root@localhost test]# cat void.sh#!/bin/bashfunction mysum(
原创 read 和 echo
read -p 和 echo 鍵盤讀入,屏幕輸出,5秒超時[root@localhost ~]# cat read.sh#!/bin/bashread -t 5 -p "Please input a string:" stringecho
原创 shell seq
seq命令順序輸出1-5[root@localhost test]# seq 1 5順序輸出1-10,步長爲2[root@localhost test]# seq 1 2 10倒序輸出10-1,步長爲2[root@localhost tes
原创 ntp 同步網絡時間
[root@localhost ~]# yum install -y ntp同步網絡時間[root@localhost ~]# ntpdate time.windows.com常用網絡時間服務器有time.windows.comntp.fu