4 2018 5 1 1 1 1.1.............................. 1 1.1.1....................... 1 1.1.2.................... 1 1.2...................... 1 1.2.1........................... 1 1.2.2............................ 2 1.3.......................... 2 1.3.1 CTRL-d.............. 2 1.3.2 CTRL-c........................ 3 1.4................................ 3 1.4.1..................................... 3 1.4.2............................ 4 1.4.3........................ 4 1.5.......................................... 5 1.5.1............... 5 1.5.2........................... 5 1.5.3.............................. 7 2 7 2.1 1.......................................... 7 2.2 2.......................................... 9 i
1 1.1 1.1.1 command file command [argument...] > file [argument... ] command [argument...] file file file command 1 cal cal 2018 cal 2018 > year year 1.1.2 > >> command [argument...] >> file date date >> year year date > year year cal 2018 > year 1.2 1.2.1 UNIX 1. (standard output): 2. stderr (standard error): command display stderr 1 set noclobber > > >! 1
1.2.2 () (redirection) 1.1 > >> 2 le command display stderr cal 2018 > year year > year cal year cal 2018 > year 2018 cal cal > year cal > year cal 1.3 1.3.1 CTRL-d 1. wc year wc 2. wc 3. ls <ENTER> 4. Ctrl d CTRL d CTRL-d wc wc 2 tcsh >& >>& 2
wc wc 3 2. wc 4. CTRL-d (; EOF = End Of File) 4 wc CTRL-d 5 1 1 wc ( ) 1 <ENTER> wc <ENTER> 1.3.2 CTRL-c CTRL-c wc CTRL-d CTRL-c wc CTRL-c CTRL-c wc CTRL-d CTRL-c 1.4 1.4.1 wc UNIX (standard input) keyboard command ( ) 3 1.4 4 Windows EOF CTRL-z 5 CTRL-d 3
1.4.2 ( ) le Keyboard command command file command [argument...] < file wc < year wc year wc wc year wc year wc < year wc (wc year) year wc wc wc wc < year wc 1. year wc year wc wc man wc man q 1.4.3 year wc.out wc wc < year > wc.out wc.out 4
1.5 1.5.1 who who wc 1. who 1 who 2. who user who > user who user cat user 3. wc -l ( ) user wc wc user wc -l < user user wc 4. user rm user 1.5.2 ( ) 6 (pipeline) 6 tcsh & 5
1: who wc who wc -l wc () wc wc () wc (who > user) 2. who user pipe who wc -l 3. user wc (wc -l < user) 2: ls more more (pager) 1 7 /etc ls more ls -l /etc more more more year ls ( l /etc) ฅ (ls) display ls (ls more) more 1. ls ls more ls 2. more ls (a) more (b) q more 7 more more less 6
1.5.3 command1 () command2 command3 () () command1 command2 command3 command1 command2 command3 command1 command2 command3 4 command2 command3 (filter) cat wc 2 2.1 1 1. echo echo hakodate campus 2. echo campus hakodate sapporo asahikawa kushiro iwamizawa 3. tr tr (a) tr tr a A hakodate sapporo tr (b) tr tr a-z A-Z 7
hakodate sapporo ( campus CAMPUS tr 4. sort () sort file... sort file... file... (a) sort campus sort campus (b) sort hak sap asa sort (c) sort campus (d) campus campus s 5.. (a) ls wc (b) (c) (a) 6. grep grep pattern file... grep file... patten file... grep ko campus grep sa campus grep who grep 8
2.2 2 1. cat cat cat (a) cat cat (b) hakodate <ENTER> hakodate hakodate cat (c) sapporo <ENTER> (d) cat CTRL-d cat (e) cat hakodate mycampus 2. cat cat cat mycampus mycampus2 3. cat cat (concatenate) (a) cat campus mycampus (b) campus mycampus campus mycampus 4. cat cat -n who 9
5. uniq uniq uniq file uniq file file (a) sort campus mycampus campus mycampus s (b) uniq campus mycampus s uniq campus mycampus (c) sort uniq campus mycampus 10