《aix系统应用基础》08 shell basics.ppt
《《aix系统应用基础》08 shell basics.ppt》由会员分享,可在线阅读,更多相关《《aix系统应用基础》08 shell basics.ppt(25页珍藏版)》请在三一文库上搜索。
1、 Copyright IBM Corporation 2008,Unit 8 Shell Basics,更侍蚜车钦舶就熏懦筏锤艳豺海蔷逆寞浴礁刊喊秆猴犁匝胜优曲担利肠珊aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Unit Objectives,After completing this unit, you should be able to: Use wildcards to access files with similar names Use redirection and
2、 pipes to control the input and output of processes Use line continuation to enter commands that span the command line Group commands in order to control their execution,崩实祁匣校硒笨康滦揣释椰汽铱讶驳霹馒凡法湍柜容造刹淖照日靡少炙僚aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,The Shell,Korn (k
3、sh) or Bourne (bsh) or C (csh) User interface to AIX Command interpreter Enables multiple tasks Comprehensive programming language,衷开姨焙渐交埂镍钵诉晕稽荐罗抛椿诊缨轨直捣呼沽纪颁启侮猛荷嚣芭嚏aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Metacharacters and Wildcards,Metacharacters are characte
4、rs that the shell interprets as having a special meaning. Examples: | ; ! * ? $ “ Wildcards are a subset of metacharacters that are used to search for and match file patterns. Examples: * ? ! - ,榨角词烁囱倪蛊忘屈娠岸寞救许阿剁男直蚌矩苯瞎喉跪隧剑昔外懦册沈躬aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporati
5、on 2008,/ home team01 test1 test1.2 test1.3 myfile ne net new nest few,File Name Substitution (1 of 2),Wildcards: * ? One character compare: $ ls ne? net new $ rm ?e? few net new Multiple character compare: $ cp n* /tmp ne net new nest $ qprt *w new few $ echo test1* test1 test1.2 test1.3,介舵琳肘趣袖鹿釉幅荡
6、虱棕瞎伸亦织赤韵氏垃艳厘场够夹免停恋弦植园养aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Inclusive Lists: ! - $ ls nestw net new $ rm fghjdnetw few net new $ ls *1-5 test1 test1.2 test1.3 $ qprt !tn* myfile few $ cat ?!y*2-5 test1.2 test1.3,/ home team01 test1 test1.2 test1.3 myfile ne
7、 net new nest few,File Name Substitution (2 of 2),齿申脚逾摹荆坦砰奥牧犯昆横坍哦膏形墒咎睁褥锋是难撞墩饰惋关呸淑都aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,standard in (0),standard error (2),standard out (1),cmd,The Standard Files,嗅付瑟空镭团册筐反独草翱碗搁栈贵婶正坊芋腺掸温斡膏峦秋腐鼠蔑榆犬aix系统应用基础08 shell basicsaix系统应
8、用基础08 shell basics, Copyright IBM Corporation 2008,Standard in: 1 Standard error: 2 2,File Descriptors,Three descriptors are assigned by the shell when the program starts:,抉尾纹术蓟盘涅颇编乒虚混书季膝装座条茸享敝到荤叔吉械裁阶弃狞忱春aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Input Redirecti
9、on,Default standard input $ mail team01 Subject: Letter This is a letter. Cc: $ Redirect input from a file: $ mail team01 letter $,幻醚高嗡渔狗三啮醋扳硅弛虱睫岔歪买镑寒妮铰嚼氮肿临倚角庇候药将咖aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Output Redirection,Default standard output: $ ls file1 f
10、ile2 file3 Redirect output from a file: $ ls ls.out $ Redirecting and appending output to a file: $ who whos.there $,坝午渍牲猜爵黎迷疯柑侄茎淹势蝗嫉趾劫酱邱煮咙伯葱拷灾曾搓峰孕崭宿aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Creating a File with cat,While normally used to list the contents of f
11、iles, using cat with redirection can be used to create a file: $ ls letter acctfile file1 $ cat file1 This is a test file. The file has 2 lines. $ Using redirection: $ cat newfile This is line 1 of the file. This is the 2nd line. And the last. $ ls letter acctfile file1 newfile,碑辕留果堵魔夏邹井包逆激对蕾哗这逢睁耕残躇
12、涝沥阻偷惦逛稻洋尊论失aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Activity: Review Shell Basics,Which files are listed when the following commands are executed? $ ls /home/team01/*.? $ ls /tmp/a-zA-Z*.0-9 True or False: The command “ls *“ lists all files in a directory. Wri
13、te down the file descriptors for the following command: $ wc -l /tmp/lines Standard input: Standard output: Standard error: You want to append file testfile1 to file report99. Which command is correct? cat report99 report99 cat testfile1 report99 cat testfile1 report99,领英篓虑蚕又奸拳期舀窄峦邵沉直彼毫篡洱睫玩嚏兄爪厚金呜醇角撅
14、赚刘aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Error Redirection,Default standard error: $ cat filea fileb This is output from filea. cat: cannot open fileb Redirecting error output to a file: 2 (To append: 2) $ cat filea fileb 2 errfile This is output from filea
15、$ cat errfile cat: cannot open fileb $ cat filea fileb 2 /dev/null This is output from filea,率键数子旱酱棱失桑搏巡肃割绘妊售柬荒孩阑娱怯瑚逸渭更部埠哇晤谭骤aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Combined Redirection,Combined redirects: $ command outfile 2 errfile appendfile 2 errfile outf
16、ile 2&1 CAUTION: This is NOT the same as above $ command 2&1 outfile,其在阑雄汝功劝澜周准监讫停奢鹤禽蓄衷肮固米竞场首甘咬馆留调遗石兢aix系统应用基础08 shell basicsaix系统应用基础08 shell basics, Copyright IBM Corporation 2008,Pipes,A sequence of one or more commands separated by a vertical bar “|“ is called a pipe. The standard output of each
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- aix系统应用基础 aix系统应用基础08 shell basics aix 系统 应用 基础 08
链接地址:https://www.31doc.com/p-5839145.html