投影片 1

Similar documents
第零章、為何要學作業系統

untitled

untitled

untitled

人身保險業務員資格測驗方案

個人教室 / 網路硬碟

untitled

台南縣全民學區數位學習課程進階班—PhotoImpact 10

1

untitled

I/O Files讀寫檔案:

大陸黨報集團化發展之研究

移民資料

untitled

了 立 連 立 量 領 來 例 蘭 便 不 數 不 論 更 更 更 力 更 參 例 來 例 見 量 度 量 量 參 論 量 行 量 量 瑩 理 來 錄 量 量 不 力 省 力 立 力 量 量 量 了 量 便 錄 錄 錄 料 說 省 6

臺灣地區的警察教育現況與展望

Catalan Numbers簡介

專 題 論 述

untitled

微處理機實習期末專題

廢證相關作業

untitled

untitled

自由軟體社群發展經驗與 Linux認證介紹

untitled

國立陽明大學輻射防護計畫書

untitled

untitled

untitled

公立學校教職員成績考核辦法修正草案總說明

電腦組裝訓練

依據教育部八十九年 月 日臺(八九)技(二)字第 號函

untitled

untitled

第五章 鄉鎮圖書館閱讀推廣活動之分析

吃寒天真的能減肥嗎

廉 樂 不 廉 倫 理 廉 倫 理 領 不 參 領 不 若 不 不 不 不 利 聯 行 李 聯 例 律

untitled

untitled

untitled

untitled

untitled

第三章 我國非營業特種基金制度及運作現況

Shell

untitled

untitled

Microsoft Word - linux命令及建议.doc

untitled

龍華科技大學

4-04 論文封面(樣式)

untitled

國立自然科學博物館館訊第263期

untitled

untitled

第五章 實例個案

untitled

中華人民共和國殘疾人保障法(2008年修訂)

untitled

「UPENN牙醫學院見習及費城文藝之旅」成果報告書

正確的姿勢 — 疾病疼痛不上身

untitled

行政院國科會九十一年度專題研究

untitled

十四、特殊需求的嬰兒

untitled

性別主流化簡介

untitled

我最大的一次震驚,來自於不同區域客家人 客家人是邊陲

台灣經濟新報資料庫

untitled

untitled

迴授式張力控制器

untitled

untitled

個人提供土地與建設公司合建分屋並出售合建分得之房屋,核屬營業稅法規定應課徵營業稅之範圍,自本函發布日起,經建築主管機關核發建造執照之合建分屋案件,附符合說明二之規定者外,均應辦理營業登記,課徵營業稅及營利事業所得稅

說 列 流 不 不 理 料 理 路 數 錄 路 料 料 錄 路 列 來 料 便 利 行 狀 路 II

untitled

untitled

九十三年第三期檔案管理工作研習營學員建議事項答覆情形彙整表

untitled

untitled

地方公共服務績效比較評量之探討—標竿學習策略的觀點

第一章 導論

untitled

編者的話

untitled

untitled

1-2岁宝宝的游戏和活动指南

第一章 緒論

untitled

國立政治大學新研所碩士在職專班

untitled

untitled

《摘要》

untitled

四湖鄉志纂修

untitled

untitled

untitled

untitled

Transcription:

類 Linux BASH shell (, VBird) 2008/03/29 Linux 1

Bash Shell 令 vi vim 料流 令 / 令 理 (job control) 例 2008/03/29 Linux 2

Bash shell 2008/03/29 Linux 3

什 Shell Shell shell 2008/03/29 Linux 4

什 Shell Linux shell Linux shell /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/ksh /usr/bin/ksh /bin/tcsh /bin/csh /bin/zsh shell /bin/bash shell chsh s shellname 2008/03/29 Linux 5

Bash bash 令 力 類 DOS doskey 令 令 (alias) (jobs) Shell scripts 2008/03/29 Linux 6

Bash bash [Tab] [Tab] 串 令 令 [Tab] 串 令 [Ctrl]-c 行 [Ctrl]-d [Shift]-[Pageup]/[Shift]-[Pagedown] / 2008/03/29 Linux 7

Bash bash 數 數 數 = 數 數 數 數 = 來連 兩 不 數 數 數 不 來 數 來 數 \ 來 令 令 ` command` $(command) export 來 數 數 export PATH 數 unset 數 2008/03/29 Linux 8

Bash 數 / 數 echo $var echo ${var} 數 mkdir ~dmtsai 立 ~dmtsai 錄 echo $PATH PATH 數 kversion=$(uname r) kversion echo \$PATH $PATH set 數 2008/03/29 Linux 9

Bash bash 數 數 HOME MAIL HISTSIZE LANG PATH PS1 $? 錄 ~ 錄 mail ( ) history 錄 數 料 ( locale a) 令 行 錄 令 (man bash) shell PID 令 行 (0 ) 2008/03/29 Linux 10

Bash 數 數 shell shell 數 利 export 數 ( 數 ) shell ( 離 了 ) shell shell 數 數 2008/03/29 Linux 11

Bash bash 令 bash 令 cd, pwd echo jobs, fg, bg history type man cd ( ) 2008/03/29 Linux 12

Bash 歷 令 令 history [-n] history 錄 ~/.bash_history 令!!!vi!50!-5 2008/03/29 Linux 13

Bash 令 立 令 alias ll= ls al alias h=history unalias h 2008/03/29 Linux 14

Bash 令 行 若 令 ls, echo 路 / 路 行 令 (alias) bash 令 PATH 令 type a 令來 2008/03/29 Linux 15

Bash 參數 login-shell 讀 /etc/profile ~/.bash_profile, ~/.bash_login, ~/.profile non-login-shell bash 例 X bash 行 bash 行 script ~/.bashrc 不 立. ~/.bashrc source ~/.bashrc 2008/03/29 Linux 16

Bash 見 bash * 0? [a-c] [^a-c] 不 例 3 數 /etc/??? /etc/*[0-9]* /etc/*[[:upper:]]* 2008/03/29 Linux 17

Bash 切 bash 量不 root 不 切 su root su ( root ) 離 su - exit 來 切 su username 行 root 不 2008/03/29 Linux 18

令 2008/03/29 Linux 19

來 令 cat tac nl more less head tail od 行 行 行 more 類 行 行 讀 2008/03/29 Linux 20

cat nl 2008/03/29 Linux 21

head tail tail +5 /etc/man.config 行 料 來 tail f /var/log/messages 2008/03/29 Linux 22

2008/03/29 Linux 23

vi vim 2008/03/29 Linux 24

vi vim vi 什 vi vim vi Unix like vi 例 crontab vim vi vim 2008/03/29 Linux 25

vi vim vi 1G k ^ h l $ j G 離 ZZ 行 行 dd yy Pp 串 x X dw 復 u. [ctrl]-r 兩行 J / nn v y p d I i a A O o R r : [ESC] 令 離 利 :w :w! :q :q! :wq! :sp newfile, [ctrl]-w +s, [ctrl] +v [esc] :set :n1,n2s/old/new/g[c] 2008/03/29 Linux 26

vi vim vim vim :set nu ( 行 ) :set autoindent( ) :set textwidth=80( 行 ) :set hlsearch( 亮度 ) :syntax {on off}( ) ~/.vimrc 2008/03/29 Linux 27

料流 2008/03/29 Linux 28

料流 令 令 行 料 料 Standard Output (STDOUT) 料 Standard Error Output(STDERR) 令 讀 料 料 Standard Input 來 2008/03/29 Linux 29

料流 STDOUT STDERR >, >> STDOUT / 2>, 2>> STDERR / < 讀 料 2008/03/29 Linux 30

料流 例 > 2> 料 list_right list_error 不 2008/03/29 Linux 31

料流 (/dev/null) 不 2>&1 2008/03/29 Linux 32

料流 <<keyword 來 2008/03/29 Linux 33

料流 料流 來 行 不 例行 令 例 /etc/crontab 行 來 行 令 2> /dev/null 2008/03/29 Linux 34

料流 連 令 行 令 cmd1 ; cmd2 ; cmd3 令 0 行 cmd1 && cmd2 令 0 行 cmd1 cmd2 理 cmd1 && cmd2 cmd3 2008/03/29 Linux 35

令 2008/03/29 Linux 36

令 令 令 理來 令 STDOUT 不 理 STDERR cat, more, less 令 ls, cp 令 2008/03/29 Linux 37

令 cut 2008/03/29 Linux 38

令 grep 2008/03/29 Linux 39

令 sort 2008/03/29 Linux 40

令 uniq wc 2008/03/29 Linux 41

令 tee 2008/03/29 Linux 42

令 參數 xargs 令 令 讀 STDOUT 參數 (argument) 2008/03/29 Linux 43

/ 令 2008/03/29 Linux 44

/ 令 令 令 來 令 type command ex> type a echo PATH 令 which command 2008/03/29 Linux 45

/ 令 料 料 updatedb 料 /var/lib/slocate locate keyword locate r { } man page makewhatis 立 料 whatis keyword keyword man page 2008/03/29 Linux 46

/ 令 find 令 find [ 錄 ] [ 類 ] [ ] 例 24 更 (mtime) 列 [root@linux ~]# find / -mtime 0 /etc /etc/passwd 列 [root@linux ~]# find /etc -newer /etc/passwd /home dmtsai [root@linux ~]# find /home -user dmtsai passwd [root@linux ~]# find / -name passwd 1MB [root@linux ~]# find / -size +1000k 2008/03/29 Linux 47

2008/03/29 Linux 48

來 行 行 理 令 grep sed awk 2008/03/29 Linux 49

2008/03/29 Linux 50

理 (job control) 2008/03/29 Linux 51

理 (job control) Job control command & 行 jobs fg %n n bg %n n 行 kill %n n [ctrl]-z 2008/03/29 Linux 52

例 2008/03/29 Linux 53

bash && 什 例 ls foo cd /tmp; ls&& cd /tmp AB (A) 令若 行 令 不 行 令 行 令 行 (B) 令若 行 令 行 令 行 令 不 行 (C) 令若 行 令 行 令 行 令 不 行 (D) 令若 行 令 不 行 令 行 令 不 行 2008/03/29 Linux 54

Linux shell 列 ABD (A) alias (B) <tab> 令 (C) 令 ls /? (D) history 歷 令 便 令串 cat n < test1 > test2 D (A) test1 test2 (B) test1 test2 (C) test2 test1 (D) test1 列 test2 2008/03/29 Linux 55

令 cat /etc/passwd grep vincent B (A) 列 /etc/passwd (B) /etc/passwd vincent 串 列 (C) 列 /etc/passwd vincent 串 (D) vincent 串 su 令 AB (A) 切 (B) 切 切 root (C) 切 若 切 行 su 令 行切 (D) 論 若 切 切 利切 2008/03/29 Linux 56

program1 tee /tmp/logfile A (A) 行 /tmp/logfile (B) 行 (C) /tmp/logfile (D) 令 program tee > /tmp/logfile 令 列 /etc 錄 AB (A) ls lr /etc (B) find /etc -print (C) dump R /etc (D) search l /etc 2008/03/29 Linux 57

david 行 cd ~david C (A) 切 錄 david $HOME 錄 (B) 切 錄 ~david 錄 (C) 切 錄 ~david 錄 (D) 切 錄 david 錄 列 令行 錄 ( 不 錄 ) 連 A (A) ls l grep ^l awk {print $NF} (B) ls type l (C) find type l (D) ls -ll 2008/03/29 Linux 58

錄 1 2 列 令 2 B (A) /bin/false echo $? xargs ls (B) /bin/false echo $? xargs cat (C) /bin/false xargs echo (D) /bin/false xargs cat 數 兩 數 (Global) 數 (Local) 列 ACD (A) Global 數 Local 不行 (B) local 數 env (C) local 數 global export 令 (D) 令 set local global 數 2008/03/29 Linux 59

find / -name java* > msg1 2>msg2 列 C (A) 令 錄 java (B) 令 行 了 兩 (C) 令 行 msg1 行 msg2 (D) msg2 /home/peter/ibm_java 串 2008/03/29 Linux 60

bash [ctrl]-z 什 A (A) 令 (B) 令 (C) (D) 復 2008/03/29 Linux 61