Time of Update: 2014-10-29
標籤:shell#/bin/bashBackuPath=/opt/backup/WebPath=/usr/local/apache2/htdocs/DATE=`date +%Y%m%d`WebBakFIle=web${DATE}.tar.bz2DBFile=DB${DATE}.tar.bz2DBuser=‘root‘DBpassword=‘123‘FTPserver=192.168.1.107FtpTargetPath=‘ftp/backup‘cd $WebPathpwdtar jcf
Time of Update: 2014-11-05
標籤:shell指令碼1:重新導向中的錯誤和輸出定向到同一檔案的方式是: 如:ls + 1>list.txt 2>&1 或 ls + &>list.txt 而不是 ls + 2>&1 list.txt2: -exec中的{} \;這是命令格式,不是換行,中間有個空格並且\需要直接接; {}替換-exec中的輸出3
Time of Update: 2014-11-05
標籤:背景色 底線 字串 格式:"\033[顯示方式;前景色彩;背景色m 字串 \033[0m"\033 :啟動一個逸出序列[
Time of Update: 2014-11-04
標籤:blog http ar 使用 sp strong 檔案 div on http://blog.csdn.net/gyanp/article/details/7258356經常可以在一些指
Time of Update: 2014-11-01
標籤:應用程式 解譯器 linux 管道 定向 linux中shell是一個特殊的應用程式。它介於系統的核心與使用者之間。充當命令“解譯器”的作用角色。負責接收使用者輸入的操作指令,並進行解釋。將需要執行的操作傳遞給核心。並輸出執行結果;下面我們來看一下當前系統所支援的shell的種類:650) this.width=650;"
Time of Update: 2014-10-31
標籤:style 使用 sp on bs ef linux size as 給你個全的,你在Linux環境下多試下就明白了:$0 這個程式的執行名字$n 這個程式的第n個參數值,n=1..9$*
Time of Update: 2014-10-29
標籤:linux shell 反引號位 (`) 位於鍵盤的Tab鍵的上方、1鍵的左方。注意與單引號(‘)位於Enter鍵的左方的區別。反引號位 (`)在Linux中起著命令替換的作用。命令替換是指shell能夠將一個命令的標準輸出插在一個命令列中任何位置。舉個例子: [email protected]:~$ date2014年 10月 29日 星期三 15:14:46
Time of Update: 2014-10-29
標籤:style blog color ar for sp div on log 一、文法break:用來跳出迴圈。break N 可以跳出多層迴圈breakbreak
Time of Update: 2014-10-27
標籤:linux 監控進程 切換後台執行 該指令碼實現了對指定進程名的進程進行每隔2的掃描監控,一旦發現進程不存在便重新啟動。#!/bin/sha=10;while [[ @a -gt 5 ]]; do if test $(pgrep -f $1|wc -l) -eq
Time of Update: 2014-10-27
標籤:style blog io color ar 使用 for sp div 一、條件陳述式簡單條件if [ condition ]; then # 當 condition
Time of Update: 2014-10-27
標籤:shelliamlaosong我們經常在shell指令碼程式中用<<EOF重新導向輸入,將我們輸入的命令字串作為一個執行程式的輸入,這樣,我們就不需要在那個程式環境中手工輸入命令,以便自動執行我們需要的功能,例如:sqlplus emssxjk/emssxjk <<EOFselect count(*) from sncn_yxyj where create_date like
Time of Update: 2014-10-27
標籤:style blog color for sp div 2014 log line 退出狀態bash中的內建命令雖然不建立新的進程,但也會有Exit
Time of Update: 2014-10-28
標籤:style blog color ar 使用 sp div art log 一、文法case $變數 in "第一個變數內容") #
Time of Update: 2014-10-22
標籤:style blog http color ar 使用 strong sp on 查看當前系統下所有可用的Shell的類型:cat
Time of Update: 2014-10-24
標籤:shell linux 分析日誌 grep awk 需要統計使用者日誌資訊,分析出使用者行為時,用shell往往能方便地取出很多資料,取出後再放置到excel中統計。例如:統計日誌中含loadCustomProcess這個地址的訪問,按訪問耗時排序:grep "loadCustomProcess"
Time of Update: 2014-10-20
標籤:style blog http color io os ar 使用 for 一:shell編程基礎 shell定義:shell是一個作為使用者與linux系統間介面的程式。它允許使用
Time of Update: 2014-10-18
標籤:style blog http color os ar 使用 for sp 139郵箱收到郵件後會自動下發簡訊,利用這一功能可以將伺服器的異常資訊發信到139信箱然後手機端會接到簡訊提醒,
Time of Update: 2014-10-21
標籤:style blog color ar sp 檔案 div log amp 0表示標準輸入1表示標準輸出2表示標準錯誤輸出> 預設為標準輸出重新導向,與 1> 相同2>&
Time of Update: 2014-10-18
標籤:io 使用 strong sp 檔案 on amp linux bs if-then的進階特性 [[]]、[]都是用來測試( 測試分為數值比較、字串比較、檔案比價
Time of Update: 2014-10-28
linux監控某個進程的運行shell指令碼,linux監控shell指令碼 該指令碼實現了對指定進程名的進程進行每隔2的掃描監控,一旦發現進程不存在便重新啟動。#!/bin/sha=10;while [[ @a -gt 5 ]]; do if test $(pgrep -f $1|wc -l) -eq 2;then &