type \
echo unset set export
環境變數: home shell histsize mail path lang random ps1 $ ?
影響結果的語系變數: locale
變數鍵盤讀取、陣列與申明: read array declare
與檔案系統及程式的限制關係: ulimit
變數內容的刪除、替代與替換:
刪除 $ 僅刪除最短的那個 前->後
$ 僅刪除最長的那個 前->後
$ 最短 後->前
$ 最長 後->前
替換 $ 替換第乙個
$ 全部替換
變數測試與內容替換
bash登入與歡迎資訊
/etc/issue /etc/motd
bash環境配置檔案
/etc/profile
~/.bash_profile ~/.bash_login ~/.profile
讀入環境配置檔案
source .
終端機環境設定
stty set
資料流重定向
stdin:0 stdout:1 stderr:2
/dev/null
2>&1
eg:cat > catfile << "eof" 輸入eof時,結束輸入,而不再輸入 ^d
命令執行判斷依據
管道 選取命令:
cut -d '分隔字元' -f fields cut -c 字元範圍
eg: echo $path | cut -d ':' -f 1,3; echo $path cut -c 12-;
grep [-acinv] [--color=auto] '查詢字串' filename
排序命令:
sort [-fbmnrtuk] [file or stdin]
uniq [-ic]
wc [-lwm]
Linux讀書筆記(1)
作業系統的作用 作業系統的功能就是溝通使用者與硬體之間的訊息傳遞。也就是使用者面對作業系統 而作業系統 操作的是硬體 作業系統包含的內容 作業系統分為兩個東西 核心 和一對核心提供的工具 核心是用來掌管硬體的 如果核心不認識硬體那麼這個硬體就無法被呼叫 kernel kernel 管理事項有 1.s...
linux讀書筆記4
函式和引數 f f 1 2 cmd ls cm dif eq 0 代 表返回值 then echo cmd executed successfully else echo cmd terminated unsuccessfully fi 將命令序列的輸出讀入變數 將多個檔案的輸出組合起來 ls ca...
linux讀書筆記7
一些小栗子 1.求某個目錄下普通檔案的個數 path home dfds count 0 for file in l s path do if f fi le then letc ount f idon eech o count 33 求10!count 1 for num inseq 10 do ...