Time of Update: 2014-07-24
標籤:進程管理 shell 指令碼迴圈 使用!來調用過往命令!! 重複執行上一條指令!a 重複執行上一條以a為首的指令!nubmer 重複執行上一條在history表中記錄號碼為number的指令!-number重複執行前第number條指令ailas abc=‘cd xxxxxxxxxxx/xxxxxxxx/xxxxxxxxxxxxx‘unalias abc"
Time of Update: 2014-07-18
標籤:style color 使用 strong 檔案 linux 第一部分:Shell 簡介命令解釋語言程式設計語言當一個使用者登陸linux 系統後,系統就會為該使用者建立一個shell進程。Shell版本:Bourne
Time of Update: 2014-07-10
標籤:shell編程;選擇Shell編程學習之二一、bash的條件測試 測試方法或者說測試書寫:test EXPR[ EXPR ][[ EXPR ]] 例如:測試變數 User_Name 的之是否為root test $User_Name="root" [ $User_Name == "root" ] &
Time of Update: 2014-07-09
標籤:blog http 使用 檔案 資料 cti http://www.cnblogs.com/suyang/archive/2008/05/18/1201990.html從程式員的角度來看,
Time of Update: 2014-07-08
標籤:檔案 for io linux 代碼 re 代碼塊的重新導向是指在代碼塊內將標準輸入或標準輸出重新導向到檔案,而在代碼塊外還是保留預設狀態,換句話說,代碼塊重新導向指對標準輸入或者標準輸出的重新導向只在代碼塊內有效。可以重新導向的代碼塊是while、until、for,也可以是if/the
Time of Update: 2014-06-13
標籤:des class http tar com get Linux shell的&&和|| shell 在執行某個命令的時候,會返回一個傳回值,該傳回值儲存在 shell 變數 $? 中。當 $? == 0 時,表示執行成功;當 $? == 1
Time of Update: 2014-05-29
標籤:c a int linux os res ifconfig |grep "inet addr"|cut -f 2 -d":"|cut -f 1 -d " "|head -n 1ifconfigeth0 Link
Time of Update: 2014-05-22
標籤:style c tar ext color a [ awk簡介: ]awk可以從一個文本中擷取部分內容, 或者對這個文本進行排版, 使它按某種格式輸出.[ awk工作流程: ]awk會把檔案一行內容去到記憶體裡, 然後對這行內容進行分段 ( 預設按空
Time of Update: 2014-07-08
標籤:let expr $[ ] 方法1:let 算術運算運算式樣本1:[[email protected] Scripts]# A=2[[email protected] Scripts]# B=3[[email protected] Scripts]# let C=$A*$B[[email
Time of Update: 2014-06-30
標籤:shell1. 尋找目前的目錄中所有大於 500M 的檔案 , 把這些檔案名稱寫到一個文字檔file中,並統計其個數。find / -size +500M -type f | tee /root/file.txt | wc -l 或者find / -size +50M -
Time of Update: 2014-06-30
標籤:blog http 使用 檔案 os art 為何使用Shell指令碼分類: linux shell指令碼學習2012-09-12 17:18 78人閱讀 評論(0) 收藏 舉報shell指令碼任務工作 &
Time of Update: 2014-07-22
標籤:style blog http color 使用 os 1、修改密碼使用 passwd 命令修改密碼。 該命令如果在 root 使用者下執行,則修改的是 root 使用者的密碼。 2、擷取協助使用 ls --help 命令擷取協助。 1
Time of Update: 2014-07-18
標籤:style blog http color os 檔案 當我們給予shell指令碼執行的許可權後,就可以測試程式了,假設shell指令檔為hello.sh放在/root目錄下。下面介紹幾種在終端執行shell指令碼的方法:1.切換到shell指令碼所在的目錄,執行:[[email
Time of Update: 2014-07-18
標籤:使用 檔案 io re c 時間 使用date命令轉換基礎時間秒為年月日:命令為:date -d @1281161747注意一定不要忘記符號“@” #date 擷取目前時間 #date -d "-1 week" +%Y%m%d
Time of Update: 2014-07-10
標籤:blog http 2014 c log 程式 #!/bin/basha=$1 #將第一個命令列參數傳遞給變數a,第二個命令列參數傳遞給bb=$2if [ -z $a ] |
Time of Update: 2014-07-11
標籤:blog http 2014 cti io ar #!/bin/bashhello="var1"echo $hellofunction func1
Time of Update: 2014-06-14
由於應用shell的時間不是太長,對於數組在實際項目中沒有接觸過,今天在需要把類似於:a=1,2,3,4這樣的東西轉換。之前用的方法是用awk,分別取出。所以今天想是否有更好更簡潔的方法----就想到數組了。 先解決例子中的問題,例如 my_num="one,two,three,four"
Time of Update: 2014-05-28
一、命令格式gawk options program file gawk選項:-F fs 指定描述一行中資料欄位的檔案分隔字元-f file 指定讀取程式的檔案名稱-v var=value 定義gawk程式中使用的變數和預設值-mf N 指定資料檔案中要處理的欄位的最大數目-mr N 指定資料檔案中的最大記錄大小-W keyword 指定gawk的相容模式或警告層級二、 自命令列讀取程式指令碼$ gawk '{print "
Time of Update: 2014-05-08
下面的程式實現一個簡單的mp3播放功能,可以設定路徑對所有mp3檔案進行搜尋並順序播放。#!/bin/sh# very simple example shell script for mp3 player# 2014-5-6 by slwang#實現搜尋所有mp3檔案並順序播放歌曲path1=~/Musicpath2=~/Downloadstemp_file=/tmp/temp_files$$musicset=""menu_choice=""isnext=
Time of Update: 2013-12-27
在做訊號的捕捉之前需要先瞭解一下kill的使用方式:kill -l 查看訊號650) this.width=650;" title="kill-l.jpg" src="http://www.bkjia.com/uploads/allimg/131227/2315524596-0.jpg" alt="225340553.jpg"